OnTick only fires when a tick arrives
Expert advisors in MetaTrader typically run their logic on a new-tick event. If no new tick arrives, the code does not run.
This sounds obvious. The consequence is not. On a quiet pair, ticks may be seconds apart. An EA that is meant to manage a position, trail a stop, or close at a time may be sitting idle because nothing triggered it.
A close-all-at-17:00 routine does not run at 17:00 if the first tick after that time arrives at 17:00:07. A trailing stop does not move between ticks, even if the price has technically moved on other feeds.
Worse, during a fast market, hundreds of ticks queue up. The EA processes them one by one, and execution lags behind the actual price. The code works on stale data.
Workarounds include using a timer event for time-based logic, keeping per-tick code light, and avoiding heavy calculations inside the tick handler.
The behaviour is documented. Still, plenty of strategies get written without accounting for it, and the live results diverge from the backtest as a result.
Which time-based tasks in the current setup depend on a tick arriving, and what happens when the market is quiet?
OnTick only fires when a tick arrives
OnTick only fires when a tick arrives
It’s Fairman 