Page 1 of 1

Expert advisors and tick processing delays

Posted: Sat Oct 31, 2026 8:00 pm
by Amanhasnoname
An automated strategy runs code on every tick. When the code is heavy, ticks queue up, and the strategy ends up reacting to prices that are already stale.

Common causes are loops over long histories on each tick, repeated file writes, unoptimised indicator calls and excessive logging. In calm periods, the delay is invisible. In busy periods, it grows.

The symptom is a growing gap between the market price and the price the code is working with. Orders go out late, and slippage rises.

Profiling helps. Measuring the time the main function takes per tick, and logging the maximum, shows whether it's close to the interval between ticks. During news, ticks can arrive every few milliseconds.

Fixes include caching indicator values, only doing heavy calculations on new bars, moving file operations out of the tick handler, and reducing logging in live mode.

A lean tick handler is one of the best investments in a scalping bot.

What does your tick handler spend most of its time doing?