Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 581
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If you want to take an M30 candle that closed together with the last closed H1 candle, it can be a candle with index not only 1, but also 2. Another thing is that then it is not clear why the closing price of M30 is taken, if it is the same closing price for the previous H1 candle. That is, in this case there is no sense to ask the closing price of another TF, because it is the same as the closing price of the current TF.
Exactly what we need to know is the closing price of M30 inside H1
Found the reason, bar opening control. Thank you.
How in the indicator to compare, in the loop, price High[i+1] +/-10*Point with lower fractals?
if found equal, put arrow Buf_o[i+1]= High[i+1] ;.
Hello!
I want to write a simple binary strategy code for testing it with MetaTrader 4 tester. I know that the built-in tester does not fully test binary strategies, but I just need to know the share of profitable trades during the testing period. I am not able to set the expiry time of a deal. I use the OrderSend operator:
OrderSend(Symbol(),OP_BUY,1,Ask,10,0,0, "5",15167,Expiration,clrGreen);
Everything works well when performing automated trading, but according to broker's terms, the expiration period is specified in the comment to the position. In this case my comment is "5". It is five minutes. However, the tester, of course, does not consider the comment as an indication of the expiry period. The tester does not react at all to different values of the Expiration parameter. First it opens trades following the strategy's signals and then closes all open trades within the testing period at the moment of expiration of the testing period. As a result, the result of testing is absolutely incorrect.
How to specify an understandable expiry period for the tester? I am still mastering the "old" version of the code.
How do I set an expiry period that the tester can understand?
How do I makeHigh[i+1] +/-10*Point not exactly equal to the price of the fractal?
How do I makeHigh[i+1] +/-10*Point not exactly equal to the price of the fractal?
Close the position if the current time = position opening time plus 5 minutes or at the opening of a new bar, if the timeframe is M5.
Why can't the standard expiry period in the OrderSend operator parameter list work? It is marked as Expiration in my example.