Hi Rocky,
You can use TimeCurrent()with TimeMinute()modulo logic to trigger actions exactly at 15-minute marks like 9:00, 9:15, 9:30, etc.
If you need sample code, I can help you set it up.
There is many online forums where you are invited to ask requests like this, however, this is not one of those. I recommend that you search codebase and modify one of those to suite your requirements, OR go to the Freelance page and make a request there and you will get it for a fee.
This forum is mostly for help with coding, unless it is AI or ChatGPT code; but you need to post your coding attempt first if you want to get help; otherwise you will likely not get any more responses.
There is many online forums where you are invited to ask requests like this, however, this is not one of those. I recommend that you search codebase and modify one of those to suite your requirements, OR go to the Freelance page and make a request there and you will get it for a fee.
This forum is mostly for help with coding, unless it is AI or ChatGPT code; but you need to post your coding attempt first if you want to get help; otherwise you will likely not get any more responses.
Appreciate your feedback sir,
I have posted my current code ..
Hi Rocky,
You can use TimeCurrent()with TimeMinute()modulo logic to trigger actions exactly at 15-minute marks like 9:00, 9:15, 9:30, etc.
If you need sample code, I can help you set it up.
int timerminutes = 15; MqlDateTime today; int OnInit() { DrawT(); OnStartLoad(); TimeLocal(today); EventSetTimer(timerminutes*60); }
Improperly formatted post. Please use the CODE button (Alt-S) when inserting code — https://www.mql5.com/en/articles/24#insert-code or attach the file. This time I fixed it for you.
-
If you want to run on the first tick, use the M15 chart, drop the timer idea.
-
Of course, it runs randomly; you started it randomly. Run every second and wait for a quarter-hour.
int OnInit(){ ⋮ EventSetTimer(1); return INIT_SUCCEEDED; } void OnTimer(){ ⋮ static datetime lastRun=0; datetime now=TimeCurrent(), prevRun=lastRun; lastRun = now - now % (15*60); if(lastRun != prevRun) do_whatever(); } }
Improperly formatted post. Please use the CODE button (Alt-S) when inserting code — https://www.mql5.com/en/articles/24#insert-code or attach the file. This time I fixed it for you.
-
If you want to run on the first tick, use the M15 chart, drop the timer idea.
-
Of course, it runs randomly; you started it randomly. Run every second and wait for a quarter-hour.
That's exactly what I needed.
Thank you so much, William.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello friends,
I want to run a timer every 15minutes at fixed 15min candle times.
for example : at 9:00 - 9:15 - 9:30 - 9:45 - 10:00 -10:15 .. and so on..
Please guide and share the code if you already have it.
Thanks,
Rocky