If I insert a pause of one hour in my EA after a position has taken the StopLoss, does this pause also occur in the backtest or only in real?
I ask you why, I read that the Sleep function does not suspend the robot execution in the strategy tester.
Thank you all for your help.
Greetings,
Giuseppe.
- MQL4 (in Strategy Tester) - double testing of entry conditions
- Chart Event For MT4 Backtester
- resting the expert after got stoploss
Giuseppe D'Alessandro:
If I insert a pause of one hour in my EA after a position has taken the StopLoss, does this pause also occur in the backtest or only in real?
I ask you why, I read that the Sleep function does not suspend the robot execution in the strategy tester.
It depends how you code the pause.
If you use Sleep(), the backtester will ignore it. You know this from the documentation.
If you base it on TimeCurrent(), then the tester will honor it, i.e.
if ( timeOfStopLoss + 3600 < TimeCurrent() ) { . . . }
Anthony Garot:
It depends how you code the pause.
If you use Sleep(), the backtester will ignore it. You know this from the documentation.
If you base it on TimeCurrent(), then the tester will honor it, i.e.
Ok, now it's much clearer to me.
The thing that interests me is that, regardless of the backtest, the sleep parameter works in real, even if the backtest will not honor it.
Thank you very much, you have been very kind.
Greetings,
Giuseppe.
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