I wrote a 15 minute timer(15*60), but I want to make the onTimer() start regularly, for example, 00:15, 00:30, 00:45.
How should it be realized?
Thanks very much!
- Start() vs OnTimer()
- I have a question (Basic code)
- Machine learning in trading: theory, models, practice and algo-trading
Use a one minute or one second timer, and have OnTimer filter to every 15 minutes.
void OnTimer(){ static datetime nextRun=0; datetime now=TimeCurrent(); if(now < nextRun) return; nextRun = now - now % 900 + 900; // Every quarter-hour. ⋮

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