Alternative To OnTimer() For MT5 Custom Indicator

 

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

Documentation on MQL5: Event Handling / OnTimer
Documentation on MQL5: Event Handling / OnTimer
  • www.mql5.com
//|                                               OnTimer_Sample.mq5 | //|                        Copyright 2018, MetaQuotes Software Corp. | //|                                             https://www.mql5.com | "It is recommended to run the EA at the end of a trading week before the weekend...
 
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
Reason: