Hi, I need to calculate a couple of variable such as lastOpenPriceBuy, lastOpenPriceSell, lastLotBuy, lastLotSell and also totalProfitBuy and totalProfitSell, to do that I create a PositionInfo() function. void PositionInfo ( string CurrentSymbol, ulong MagicNumber, double &
Hi all, I have a requirement where I need to run an EA on Account1 which does various tasks. At certain points the EA on Account1 needs to trigger actions on Account2. After looking around a little bit, it seems like: - I will need to run the code for each account separately in different terminals
Hello all, I am writing an EA in MQL5. I have Support and resistance lines auto detecting. When a support gets taken out, it will not detect at all the next time the code runs(it will receive a new bar). It should then delete the support line that was there before, but instead, it leaves it. Why
Hi All, I am attempting to write a function that limits the number of open positions held by closing the least profitable trades, I have written the code as below but am having trouble with the PositionClose() function, is there something I am missing here? CSymbolInfo m_symbol;
Hi all, I am attempting to write a function that cycles through open positions and closes all those that are in profit by x amount and then returns true, and would return false in the case where no positions have been closed, I have the following code which seems to be ineffective, could someone
double arr3[ 3 ][ 2 ][ 2 ]; arr3[ 0 ][ 0 ][ 0 ]= 1 ; arr3[ 0 ][ 0 ][ 1 ]= 2 ; arr3[ 0 ][ 1 ][ 0 ]= 11 ; arr3[ 0 ][ 1 ][ 1 ]= 12 ; arr3[ 1 ][ 0 ][ 0 ]= 111 ; arr3[ 1 ][ 0 ][ 1 ]= 112 ; Print ( "it is " ); ArrayPrint (arr3); I've created a 3d array and partially populated it. However I can't get
[Deleted]
I have an expert running , how can i call its functions from a script without the #import. Expert: void MyFunction(){ Print ( "Hello" ); } void OnInit (){ } void OnTick ( void ){ } Script: void OnStart ( void ){ //Call MyFunction here ... }
Hello, please can help code now work with stop loss and take profit #include <Trade/Trade.mqh> CTrade trade; input int InpFastPeriod = 14 ; // Fast period input int InpSlowPeriod = 21 ; // Slow period input int InpStopLoss = 100 ; // Stop Loss input int InpTakeProfit = 200 ; // Take Profit
[Deleted]
How can i get current bar's time in seconds Comment ( TimeGMT (), " " , " " , TimeToString ( iTime ( NULL , 0 , 0 ), TIME_DATE | TIME_SECONDS )); TimeGMT works fine but i want to get bar time in seconds output
Hello I am getting into a discussion if the above is possible. I am not talking about the option "All Symbols in Market Watch " but instead running iteration of the various inputs on different symbols (on a single-symbol EA) with the Symbol being one of the things changing in each pass. The purpose
#include <Expert\Expert.mqh> MqlTick last_tick; MqlTick tickarray[ 2 ]; double last_bid = last_tick.bid; double last_ask = last_tick.ask; int openpositions = PositionsTotal (); bool levelcheck(); double bsl = last_ask - 150 * _Point ; double btp = last_bid + 300 * _Point ; double ssl = last_bid +
my EA places buyStop and sellStop orders when certain criteria are met after so many trials and errors, i realised the validation does not pass this line of code double ask = SymbolInfoDouble ( _Symbol , SYMBOL_ASK ); double bid = SymbolInfoDouble ( _Symbol , SYMBOL_BID ); int stopLevel = (
Hello Folks, I assume that its a quite easy question for you but I need your help. I got a website where I want my future EA clients to but their AccountIDs for a license Check. When I call the API via Postman I get the data, however I am unable to adapt the Webrequest() function accordingly to get
i have an EA that trades 9 pairs the strategy works best for different timeframes for each pair it has been indicated in the code to use the specified timeframe for each pair when i run the code in the tester with visualization on, i can select any time frame in the strategy tester menu and the code
Hello every one need help i created a function to calculate lotsize and to risk a certain percentage of account balance i have tested the the function on currency pairs and it works perfectly but when i try to use it on boom and crash indices it fail to calculate lot size and i get an error in the
Hi, im trying to set an SL price below the candlestick low. Ive tested everything separately and it all works yet currently the SLinPips printed for JPY pairs are inaccurate. input double sl_extras = 1 ; //pips string symbol_loop[] = { "GBPUSD" , "EURJPY"
Hi there due to my expert it's not getting profitable due to spend on commissions my question is the following: How to save on commissions by using PositionCloseBy? Made a test by using this code but it's not working the same as the original version (less profit): int OrdersCount= 0 ;
Hi everyone, I'm new in MQL5 and the following code is not working for me, what I want is that when it detects the crossing of the two H1 moving averages, I change the period with ChartSetSymbolPeriod to M5 and place the purchase order (orderSend) and close the purchase (orderClose or trade
Hello. I'm having a problem with my EA. I have the following message repeating: 2022.07.06 13:11:46.206 MemoryException 1228800 bytes not available, 0 heapmin result 2022.07.06 13:11:46.206 MemoryException 1228800 bytes not available, 0 heapmin result 2022.07.06 13:11:46.207 MemoryException 1228800
hi everyone I am looking for a free expert advisor who can open and close positions with keyboard shortcuts please? I would like to have a base so that I can modify it for keyboard shortcuts. Best Reguards, ZeroCafeine 😊
I keep running into this error at the automated validation testing: test on EURUSD,H1 (netting) strategy tester report 606 total trades test on XAUUSD,D1 (netting) 2018.06 . 25 01 : 34 : 00 failed exchange buy 0.20 XAUUSD at 1271.980 sl: 1271.480 tp: 1272.480 [Invalid stops] 2018.06 . 27 01 : 00
Hi, is there a way to log additional metrics during optimization? I would like to collect more information about an optimization run and to sort the results by these additional (non optimized) metrics. More precise: I woul like to have a nother column "MyMetric" after the "Sharp" Column. Is it
Optimization Solution/elimination of unwanted passes at the very beginning of the optimization/ (highly Expert Moderator-Programmer case)
(14 1 2)
Hello Everyone I have a problem in optimization passes. I've searched a lot but none of questions nor the answers in the forum was the one solving this problem. The problem is that I have some Boolean parameters in my inputs which when they are set as false there is no need to optimize some other...
HI everyone today I coded this ea and it works but I've a problem with the buy positions, when opening a buy positions, the ea close it at the next bar! please help me! #property copyright "Copyright 2023, MetaQuotes Ltd." #property link " https://www.mql5.com " #property version "1.00"
Hello Dears First of all, I must say that my English is very poor and I wrote this text with Google Translate. If you see any mistakes in my text, I apologize in advance. ----------------------------------------------------------------
Hello, good day programmers, I have tried to eliminate the arrows and trendlines from the autotrades but they are only removed from the current chart but not from the other charts opened by the strategy tester. and in the same way when I call the function in the OnDeinit() part they are not
Hello, I want to calculate the equity for each symbol separately, but my current code calculates the overall account equity instead. For instance, if my trading bot handles multiple currency pairs, and I only want the equity for the EURUSD pair, what code should I use? Can someone assist me in
Below is a code that creates 2 bitmap object. These objects gets resized accordingly whenever there's changes to the chart ie slide, zoom. You will see those objects flickering when you slide & zoom. Thanks! #property copyright "Copyright 2023, MetaQuotes Ltd." #property link
I have a script letting user to customise the chart properties. I use ChartSetSymbolPeriod to change the chart timeframe. my last input in the script is to save the template. problem is ChartSetSymbolPeriod causing the script to be terminated and then I recieve error in applying template. How to fix
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
If you do not have an account, please register
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.