
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
I have created a custom indicator using...
..and at some later stage, I attach it to a new chart that I have created...
I believe the custom indicator is correctly attached to the chart because the OnChartEvent() function is correctly processing messages.
Inside the OnInit() function of the indicator, I create a 1 second timer using EventSetTimer(1), but the timer is not firing at all (OnTimer() not called).
I then wondered if it was not firing because the timer in the indicator was created and running for some time before being attached to a chart, so I modified the EA to post a message to the indicator once the indicator was attached to the chart. I then create the timer at this point...
...but still I am unable to get the timer to fire. I have checked GetLastError(), and there are no errors.
So my question is, should this work or will the OnTimer() only work in an EA?
If this should work, and I hope that it should, can someone please highlight where I am going wrong.