Execution of EA between Ticks

 

Hello,

I want my EA to be executed on every tick and, if there is no new tick for several seconds, to be executed every xxx ms (for example 500ms).

What is the best way to code this in MQL?

Thanks in advance!

 
EventSetMillisecondTimer() ?
 

But most importantly!

  • First read the entire documentation and look at example code in the Code Base, as well as learn basic coding in a language like C or C++ before even contemplating coding in MQL.
  • Also, learn the difference between MQL4 and MQL5. They are not the same! The link you provided is for MetaTrader 5 and not MetaTrader 4 (which the basis of this MQL4 forum).
 
jan100: I want my EA to be executed on every tick and, if there is no new tick for several seconds,
The real question is why? No new tick, nothing has changed.
Reason: