No need to called OnTimer() from OnInit().
Here's a very basic OnTimer() example that works:
#property strict long g_timerCount = 0; int OnInit() { EventSetTimer(1); // every second return INIT_SUCCEEDED; } void OnTick() {} void OnTimer() { PrintFormat("%s(): g_timerCount [%d]", __FUNCTION__, g_timerCount++); }
edit : the method OnTick is called once too even if the EA is in the Chart running and the price changes.
In my computer works fine, but when i put in my VPS,don't work. ( i have other expert advisors running without problems. )
Build :1940
No idea. Post your code if you want additional help.
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 discover out why OnTimer is called once.
in my Init Method i have :
Inside the method OnTimer,i'm printing a number.
But this number is printed once and the OnTimer is not called anymore.
Do you have any suggestions ?
edit : the method OnTick is called once too even if the EA is in the Chart running and the price changes.
In my computer works fine, but when i put in my VPS,don't work. ( i have other expert advisors running without problems. )
Build :1940