Download MetaTrader 5
To add comments, please log in or register
We have launched Spanish and Portuguese versions of the website. Try them!
Tinashe Chipomho
248
Tinashe Chipomho 2014.02.26 01:27 

Ok i have a question regarding the timer function, when a timer elapses the OnTimer function is called, suppose i have a timeout of 3seconds and the timer is triggered and my EA takes more than 3seconds to run, is the timer function going to trigger even if the other function is not yet finished, it it does trigger

what happens to the global and local variables that are already being used?

I have an interesting case where I am getting some "Access violation read/write to 0x...." on random location of the timer function please help.

Alain Verleyen
Moderator
28520
Alain Verleyen 2014.02.26 08:54  
tinashe:

Ok i have a question regarding the timer function, when a timer elapses the OnTimer function is called, suppose i have a timeout of 3seconds and the timer is triggered and my EA takes more than 3seconds to run, is the timer function going to trigger even if the other function is not yet finished, it it does trigger

what happens to the global and local variables that are already being used?

I have an interesting case where I am getting some "Access violation read/write to 0x...." on random location of the timer function please help.

  • If your EA takes more than 3 seconds to run, I suggest to revise your algorithm.

...If the Timer event is present in the queue or is being processed, the new Timer event will not be placed in the queue of the mql4 program.

  • It happens nothing to global/local variables, what do you mean ?
  • Please give us more information about you error message and code who produce it if you need help on this point.
Ovo Cz
2955
Ovo Cz 2014.02.26 12:16  
tinashe:

Ok i have a question regarding the timer function, when a timer elapses the OnTimer function is called, suppose i have a timeout of 3seconds and the timer is triggered and my EA takes more than 3seconds to run, is the timer function going to trigger even if the other function is not yet finished, it it does trigger


I believe that OnTimer has uniform behaviour as OnTick or onCalculate, i.e. it does not create a queue nor triggers the function concurrently, but rather throws away the event.

/
To add comments, please log in or register