Questions from Beginners MQL5 MT5 MetaTrader 5 - page 970
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
But I have not found any recommendations, examples how to program this condition to be similar to OHLC M1, and is it possible at all?
So far I got the following divergence on the same type of settings.
"OHLC M1 ; 8 years; 1681 trades. (initially I used this method)
"Opening prices" ; 8 years; 1655 trades.
"All ticks" 8 years; 1676 trades.
The algorithm seems to be robust, and I may even be able to improve results of each method separately,
but it would lose versatility and appear redundant.
In short, as an example, if you have TP buy positions set at 1.16000, then "all ticks" will close at about this price. OHLC will close at that price above 1.16000 and that can be quite a big difference, so OHLC will always show better results. Same story with "At opening prices".
Briefly, as an example, if TP buy positions are set at 1.16000, "all ticks" will close at approximately this price. OHLC will close at the price that was above 1.16000 this and may be quite a big difference, so always OHLC will show better results. Same story with "At opening prices".
Nauris, thank you. I understand (I can guess) why the results differ from method to method. But what I want to understand is this:
If the tester simulated "OHLC M1" method, then how to repeat the same method in the Expert Advisor programmatically.
The tester reproduced it somehow...
Nauris, thank you. I understand (I can guess) why the results differ from method to method. But what I want to understand is this:
If the tester simulated "OHLC M1" method, then how to repeat the same method in the Expert Advisor programmatically.
The tester has somehow reproduced it...
Trust me, you don't need such precision, optimize the result and run it on all ticks, the best option ...
If you're not 3-4 pips away, it wouldn't make much difference if it closed with two pips more or less...
And playing something in the Expert Advisor won't make your time go faster, but on the contrary, it will take too long...
Believe me, you don't need such precision, optimize the result and run it on all ticks, the best option ...
If you're not 3-4 pips away, then there's no big difference if you closed with two pips more or less...
Playing something back in the Expert Advisor won't speed up the time, but on the contrary, it will slow it down...
Thank you. If no one will continue the way to implement"OHLC M1" method, I will just be condemned to use your advice)))
Thank you. If no one will continue the method of"OHLC M1" I will be condemned to use your advice))))
If you don't think of a particularly brilliant idea, the difference is in the direction of ticks, in real trading, the ticks may open, bottom, top, close, and if the candle is big, you can buy at the bottom and get a profit by the close, in simulation the candle is formed as open, top, bottom, close, let's say the open and top coincide with the bottom and close too, then on such a candle, you can buy, but not get profit, and if the market has gone down, then here you have a hanging loss order ...
... hence the divergence...
Thank you. If no one continues on how to implement the"OHLC M1" method, I'll just be condemned to take your advice)))
Thank you. If no one continues on how to implement the"OHLC M1" method, I will just be condemned to take your advice)))
Open/close in Expert Advisor not by price levels but by Open. There is an open/close signal, wait for the next 1M candle and open/close.
The method speaks for itself. Use in your EA only the OHLC prices of all the minute bars included in the current bar.
Artyom, I have tried it. On all conditions, opening and modification of orders I have put a condition "on birth of a new bar" through boolean functionisNewBar()
like this:
TheisNewBar() function itselffrom the examples and code.base articles.
It seems to work and places orders and modifies them only at a new bar, but for some reason there is a discrepancy.
There is a discrepancy betweenOHLC on M1 which I have applied withoutisNewBar() and "all ticks" withisNewBar() function.
I expected that by applyingisNewBar() on "all ticks" I would get the same result asOHLC on current prices.
So, I do not understand whether I must have screwed up the code or else I do not understand correctly theOHLC modeand expect that it is impossible.
I don't know where to dig.
Artyom, tell me more, if it is not difficult.
The order can be set and modified on a new bar, but SL and TP (in the tester) will work inside the old bar anyway?