Run it inside a while loop, and Sleep( XXminutes*60*1000); before the next iteration.
int start(){ while(!IsStopped()){ ... run your script code here Sleep( XXminutes*60*1000); } return(0); }
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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 search for a solution to run script after each XXminutes (XX = 10, 15, 30).
The one I have for now works as designed but only once. Next time I want to run it, I should hit Hot-Key or click a mouse. I would like to run it automatically. The Script writes some data into a csv file (quotes, tech indicators, open positions).
I am aware of Expert Advisers that run on each tick, but unfortunately my script when inserted into start() function of Expert Adiser doesn't produce any result (file is not being updated), beside I would like to write to a file only after a period is passed, not constantly. (that is because I am going to access the file from another application)
Could anyone kindly advice?
Thank you very much indeed!