Expert advisors and the tick queue nobody mentions
An expert advisor on MetaTrader runs its logic when a new tick arrives. If the previous run is still going, new ticks are not queued in a long line. They are dropped or merged, depending on the situation.
During quiet markets this does not matter. During fast ones, when dozens of ticks arrive per second, an EA with heavy calculations can fall behind and make decisions based on stale data.
The result looks like randomness: orders placed a little late, exits missed, trailing stops that fail to trail. Backtests show none of it because the tester processes ticks in a controlled order.
Writing efficient code helps. So does moving heavy calculations out of the tick handler, using timers for slower logic, and avoiding unnecessary indicator calls.
For anyone running a bought or borrowed EA, it is worth watching the CPU use on the machine during a news event. A spike near the limit suggests the code is struggling.
A simple measurement helps: log the time between the tick arriving and the order leaving, inside the EA, using the platform's microsecond counter. The average is usually fine. The maximum during news is the number to worry about.
Has an automated system ever behaved strangely in fast markets in a way a backtest could not reproduce?
Expert advisors and the tick queue nobody mentions
Expert advisors and the tick queue nobody mentions
It’s Fairman 