In MetaTrader, EAs are single threaded, and each event, be it Tick, Timer or Chart, will be placed in a queue and processed one at a time. Only after returning from the current event handler will the next event in the queue be processed.
Delaying the return of an event handler will delay the whole queue of pending events. For this reason, event handler functions should be efficient and return as soon as possible.
EDIT: Duplicate events are not added to the queue. For example, if there is already a Tick event in the queue, or it is being processed, then that event is not added.
In MetaTrader, EAs are single threaded, and each event, be it Tick, Timer or Chart, will be placed in a queue and processed one at a time. Only after returning from the current event handler will the next event in the queue be processed.
Delaying the return of an event handler will delay the whole queue of pending events. For this reason, event handler functions should be efficient and return as soon as possible.Why are you causing your own problems? If nothing has changed, there is nothing to do. Your “operations” should be in OnTick.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to use OnTime() with high frequency and give it a lot of operations, so I am not sure if all of them will be processed in a given timeframe.
Will next OnTime() break execution of my code or it will wait untill everything in the previous OnTime() is executed?