while (isNewBar() == true)
-
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
New candle - MQL4 programming forum #3 2014.04.04I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
Running EA once at the start of each bar - MQL4 programming forum 2011.05.06 - Drop your loop. Return and wait for the next tick.
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
Hello, I am having issues when putting this into the backtester. When i run this EA without the reversal bar params(high[1] >high[2]etc.) and put a simple buy order in its place, the EA exits as it should at the open tick of a new bar. Why is it not working with the simple reversal params?? When i backtest it only recognizes 2 trades from the 9/28-10/28(2020) daily timeframe. there are at least 5 trades to take. the attachment below shows the trades it took. since those 2 trades in the backtest did close, it should have recognized the other possible trades. How can i correct this? And thank you for any help, it is much appreciated!! i have been spending a lot of time on thi and can't seem to crack it.