Question on OnTimer

 

When a timer expires the terminal "jumps" to "OnTimer" 

If the EA is working in some function 3 levels down (calling sub functions) how is that handled?

Is the code interrupted and then resumed att the correct place or has the timer to wait until the EA gets into an idle state?

 
ingvar_e:

When a timer expires the terminal "jumps" to "OnTimer" 

If the EA is working in some function 3 levels down (calling sub functions) how is that handled?

Is the code interrupted and then resumed att the correct place or has the timer to wait until the EA gets into an idle state?

No the code is not interrupted, the timer event is placed on a queue.

EDIT: If the running code (function) originated from a previous timer event, then the new timer event WILL NOT be enqueued.

Documentation on MQL5: MQL5 programs / Program Running
Documentation on MQL5: MQL5 programs / Program Running
  • www.mql5.com
MQL5 programs / Program Running - Reference on algorithmic/automated trading language for MetaTrader 5
 
angevoyageur:

No the code is not interrupted, the timer event is placed on a queue.

EDIT: If the running code (function) originated from a previous timer event, then the new timer event WILL NOT be enqueued.

OK, thanks angevoyageur.
Reason: