Luca: I found some documentation that in MQL5 OnTimer() is limited to EAs and doesn't work with custom indicators.
Test it and see. It should work.Each Expert Advisor and each indicator work with its own timer
Event Handling / OnTimer - Reference on algorithmic/automated trading language for MetaTrader 5
Event Handling / OnTimer - Reference on algorithmic/automated trading language for MetaTrader 5

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 am converting a custom indicator from MT4 to MT5 and it uses the OnTimer() function other than the OnCalculate.
I found some documentation that in MQL5 OnTimer() is limited to EAs and doesn't work with custom indicators. https://www.mql5.com/en/docs/event_handlers/ontimer
Does anyone have an alternative?
I also thought of spinning an infinite loop with a Sleep(1000) but that is not allowed either in Custom Indicators...
Thank you in advance