You need to call EventSetTimer() again.
Each time you want to change timer interval you should call EventSetTimer() with new interval.
drazen64:
You need to call EventSetTimer() again.
Each time you want to change timer interval you should call EventSetTimer() with new interval.
Genius! I called EventSetTimer in onTimer function again, and it solved problem very easily.
Thank you very much!!

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! I'm trying to build my first EA.
Is there anyone who knows how to build the variable EventSetTimer function?
As you know, EvenSetTimer() is usually called in init() with fixed int variable, like EventSetTimer(60);..
But I'd like to make the 60sec to variable one by using another variable. So I tried like below...
int Timer;
on OnInit()
{
Timer = 1;
EventSetTimer(Timer);
................
}
void OnTimer()
{
....
Timer = 30;
....
}
How could I solve this issue? Thank you in advance for your comments.