- Detect stop trigger in OnTradeTransaction backtest
- Event handling OnTick and OnChartEvent
- Do events like OnTick() queue up ?
Forum on trading, automated trading systems and testing trading strategies
How OnTime() works if previous onTime() cycle is not finalised?
Fernando Carreiro, 2023.04.23 11:03
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.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use