![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
No, you are not supposed to run EventSetTimer() repeatedly. You only set it once, for example in the OnInit(), or on the first OnTick(), and never again for the duration of the EA, disabling it in the OnDeinit() cycle.
The only other time you would need to call it again, is if you need to change the timer frequency.
EDIT: If you are using MT4, then also, please read the following thread as it might be related:
Hello Fernando,
Great to read your comment.
Could you please explain how to change the timer frequency. I looked several threads, not finding an answer. I think my code ignores the new frequency of 60 seconds and just uses the 5 seconds the entire time. :(
Thank you in advance.
By killing the timer with EventKillTimer and setting a new one with EventSetTimer or EventSetMillisecondTimer.
Good evening Fernando,
Thank you for your answer. At the same time where should I do this in the code above.
I think I got it now, using the integer s to check if the comment shown on the chart changes every 5 seconds or every 60 seconds after the 1st run.
If you want to become a good programmer — Don't Ask, experiment!
If you want to become a good programmer — Don't Ask, experiment!
Perfect. I think I got it (see the changed code) :) . Have a nice evening and thank you.