Modelling Latency as a Distribution
Simulating a fixed latency number treats a fill as certain whenever the backtest says you'd arrive in time. Real latency is a random draw, and a backtest that ignores its spread will systematically overstate fill rates for anything time-sensitive.
Prerequisites: Wire-to-Wire Latency Decomposition
A liquidity-taking strategy backtests using a flat 300-microsecond latency: whenever the signal fires, the simulator assumes the order arrives 300 μs later, checks whether the target price was still available at that instant in the historical book, and fills if so. On that assumption the backtest reports an 88% fill rate. Live, the fill rate is 61%. The strategy's real latency averages almost exactly 300 μs — it's the flat assumption that's wrong, not the average. Real latency is right-skewed, and the difference between "usually 300 μs, occasionally 900 μs" and "always 300 μs" is invisible to any backtest using only the mean.
Why the mean is the wrong summary
A liquidity-taking order only fills at the target price if it arrives before that price disappears. The order book moves on its own clock — sometimes the price sits available for 2 milliseconds, sometimes for 100 microseconds. Fill probability is not a function of average latency; it's the probability that a random latency draw lands under a random, and often correlated, price-availability window:
where is your latency (a random variable) and is how long the price stays available (also random, and typically shorter exactly when the market is moving fast — which is also when latency tends to spike, because busy periods stress the same systems). Replacing with its mean answers a different, easier question and gets a different, wrong answer whenever 's distribution has meaningful spread — which real latency, being bounded below by physics but unbounded above by queueing and contention, always does.
Worked example: log-normal latency versus a flat assumption
Suppose measured live latency fits a log-normal distribution with median 280 μs and 95th percentile 850 μs (mostly fast, with a fat slow tail from OS jitter and network contention). The price-availability window , from historical book data, is exponential with mean 500 μs. Using the flat-latency backtest ( μs always): fill rate is , roughly 55%.
Now draw from the log-normal and compute by Monte Carlo across 100,000 paired draws. That fraction comes out near 46% — lower still, because the log-normal's fat right tail produces slow draws the flat 300 μs assumption never generates, and those are exactly the draws most likely to miss a short-lived .
Worked example: why correlation makes it worse
Let 's mean shrink to 200 μs specifically during the 10% of ticks flagged high-volatility, and 's median simultaneously rise to 450 μs during those same ticks (contention on the same busy systems). Fill rate during the volatile 10% drops to roughly 18%, staying near 52% the rest of the time — a blended rate near 49%, barely different from the uncorrelated case. But the strategy's P&L concentrates in exactly the volatile ticks where fill rate is worst, so the realized outcome is closer to the 18% regime than the blended average suggests.
Widen the standard deviation on the plot above and picture the right tail stretching out: that stretch is exactly what a flat-latency backtest deletes, and it decides whether a fast-moving order gets filled or missed.
Fill rate depends on the probability that latency beats a shrinking window, , not on average latency. Model as a distribution — log-normal is a common fit — and simulate the comparison rather than plugging a mean into a deterministic check.
The classic confusion: assuming latency and market conditions are independent, so a correlated Monte Carlo and an uncorrelated one give "close enough" blended numbers. They can look close in the blended average while being very different where the P&L actually concentrates — busy, volatile periods inflate latency and shrink the fill window at once, disproportionately the periods a time-sensitive strategy most wants to trade.
What this means in practice
Fit a distribution to measured live latency, let it vary by regime rather than using one global fit, and simulate fill probability as per event rather than a single pass/fail check. See Wire-to-Wire Latency Decomposition for where the tail in comes from, and Modelling Fill Probability for a Resting Order for extending this into a full simulator.
Related concepts
Practice in interviews
Further reading
- Aldridge, High-Frequency Trading: A Practical Guide
- Cont, Kukanov & Stoikov, The Price Impact of Order Book Events