Advertisement IC Markets

Latency in the tester versus latency in reality

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
Fairman
Posts: 6757
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Latency in the tester versus latency in reality

Post by Fairman »

Latency in the tester versus latency in reality

Backtests typically assume orders fill instantly at the signal price. In reality, there is a delay between decision and fill, and in that delay price moves. For a scalper with a tight target, even 200 milliseconds can matter.

The cost of latency depends on volatility. In a quiet tape, price barely moves in a fraction of a second. During active periods, which is when many scalping signals fire, price can move a pip or more in the delay.

To model it, add a delay to the simulated fills, using the observed distribution of real latency, not a single average. Apply the first available price after the delay, using the ask for buys and the bid for sells. Then compare the results with the zero-latency case.

The difference is often large, and it widens during volatile hours. A system that only works with zero latency is not tradable.

If the tester does not allow latency, post-process the signals with a custom script using tick data.

How much did performance drop after adding a realistic latency model to the backtest?
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
Post Reply