Download MetaTrader 5
To add comments, please log in or register
Publish your article and thousands of people all over the world will read it!
Ingvar Engelbrecht
4438
Ingvar Engelbrecht 2015.02.09 20:59 

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?

Alain Verleyen
Moderator
30180
Alain Verleyen 2015.02.09 21:49  
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
Ingvar Engelbrecht
4438
Ingvar Engelbrecht 2015.02.10 00:31  
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.
/
To add comments, please log in or register