What code have you tried so far?
adibi83:
Why not just return(0); immediately from start when you don't want it to do anything ?
Hi everyone,
I'm looking for a way to automatically stop\pause my algo for X days in certain cases. Any idea\snippet for that?
I would create a global variable when the EA should start the "pausing" period, the value would be the datetime of next run:
GlobalVariableSet("nextrun", TimeLocal()+86400*3) // 3 days, 1 day=86400 second
Then at the beginning of the start() I would check for example:
if (TimeLocal()<GlobalVariableGet("nextrun")) { return(0); }
TimeLocal may be any kind of time you calculate with.
This is a simplified example with no error handling, etc.

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
Hi everyone,
I'm looking for a way to automatically stop\pause my algo for X days in certain cases. Any idea\snippet for that?
Thanks