Slippage and Latency Modeling in Backtesting
Backtests are usually too optimistic for one simple reason: they assume the market waited for you. This paper decomposes latency, models fill prices with market impact, and shows why PnL arises from signal after implementation.
Abstract
Backtest engines routinely overstate strategy performance by ignoring the mechanics of order execution. This paper presents a latency decomposition framework and fill-price model incorporating spread crossing, market impact via square-root law, and stochastic drift during the decision-to-fill interval. Realistic slippage modeling is shown to be inseparable from strategy definition itself.
Key Takeaways
- Total latency decomposes into decision, queue, network, and venue components, each contributing to adverse price movement.
- Fill prices should be modeled as the future midprice plus half-spread, market impact, and noise, not the current mid.
- The square-root impact model calibrates execution cost as a function of volatility and participation rate.
- A strategy with a 1.5 Sharpe in a frictionless backtest may collapse below 0.5 after realistic fill modeling.
- PnL arises from signal after implementation. Slippage is part of the strategy definition, not a cost assumption.
Introduction
Backtests are usually too optimistic for one simple reason: they assume the market waited for you. Between the instant a signal is computed and the instant an order is filled, several things happen. Threads wake up, messages are serialized, risk checks run, gateways forward packets, the venue processes the order, and other participants move the book. By the time the fill occurs, the price you thought you traded may no longer exist.
Latency Decomposition
A practical fill model for a buy order (where \(M_t\) is the reference midprice at decision time):
Market Impact
A commonly used specification for market impact uses a square-root law:
where \(\sigma\) is volatility, \(V\) is available volume, and \(\eta\) is a calibrated coefficient.
Python Fill Simulator
import numpy as np def simulate_fill(mid, spread, sigma, q, V, latency_ms, side, eta=0.1): # side: +1 for buy, -1 for sell impact = eta * sigma * np.sqrt(max(q, 1) / max(V, 1)) noise = np.random.normal(0, spread * 0.05) # latency drift: price can move during delay drift = np.random.normal(0, sigma * np.sqrt(latency_ms / 1000.0)) future_mid = mid + drift fill = future_mid + side * (0.5 * spread + impact) + noise return fill # Example for side in [1, -1]: f = simulate_fill( mid=100.0, spread=0.02, sigma=0.01, q=10_000, V=1_000_000, latency_ms=8, side=side ) print(ff"Fill ({'buy' if side > 0 else 'sell'}): {f:.4f}")
Implications
A strategy with a 1.5 Sharpe ratio in a frictionless backtest may collapse below 0.5 after realistic fill modeling. Mean reversion strategies are especially vulnerable because edge decays quickly and costs are frequent. The broader lesson: PnL does not arise from signal alone — it arises from signal after implementation. Slippage and latency are not "cost assumptions." They are part of the strategy definition.
Related Research
Assumptions
- Impact scales with the square root of participation. The model treats impact as proportional to volatility times the square root of order size over daily volume. It is an empirical regularity across venues and decades, not a law, and it fits large institutional orders better than small ones.
- Volume is forecastable enough to plan against. Participation rate is computed against expected daily volume. On a news day the denominator is wrong in the direction that flatters the estimate.
- Spread is paid on entry and exit. Half-spread each way is the floor for a liquidity-taking strategy, before any impact.
- Delay cost is proportional to signal decay. The cost of waiting is only estimable if you know how fast the alpha decays, which most backtests never measure.
Robustness: what would change the conclusion
A single flat cost assumption is the most consequential modelling error in most backtests. Using a fixed number of basis points makes cost independent of size, volatility and liquidity — the three things it actually depends on — and the error grows with turnover, so it punishes exactly the strategies that look best gross.
Impact coefficients are regime-dependent. The constant in front of the square-root term is fitted, not universal. It widens in stress and differs by venue, sector and market-cap band.
Adverse selection sits outside this model. Spread plus impact plus delay does not capture the cost of being filled by better-informed flow. That component is what VPIN attempts to measure, and ignoring it biases cost estimates downward for passive strategies specifically.
QuantMedia has not validated these coefficients on its own executions. This site runs no execution and holds no fill data, so nothing here is calibrated against realised trading. The model is presented as the standard framework with its parameters exposed, not as a fitted result.
Limitations
- The square-root law is empirical, not physical. The impact coefficient varies by asset, venue, participation rate and regime. Treat it as a calibration target with a sensitivity range, not a constant.
- Calibrated on normal conditions. Impact estimates derived from typical trading understate stress. In dislocations, depth vanishes and realised cost can exceed the model by multiples.
- Omits several real costs. The decomposition here covers spread, impact and delay. Commissions, exchange fees, borrow costs, taxes and opportunity cost from unfilled orders are strategy-specific and excluded.
- Fill assumptions remain optimistic. Assuming complete fills at the signal price is generous precisely in the conditions where signals tend to fire.
References
- Almgren, R. & Chriss, N. (2001). “Optimal Execution of Portfolio Transactions.” Journal of Risk 3(2), 5–40.
- Almgren, R., Thum, C., Hauptmann, E. & Li, H. (2005). “Direct Estimation of Equity Market Impact.” Risk 18(7), 58–62.
- Kyle, A. (1985). “Continuous Auctions and Insider Trading.” Econometrica 53(6), 1315–1335.
- Perold, A. (1988). “The Implementation Shortfall: Paper versus Reality.” Journal of Portfolio Management 14(3), 4–9.
QuantMedia research is independent and not peer reviewed. These references are the primary sources the analysis draws on; readers are encouraged to consult them directly rather than relying on this summary.
Research record
- Author
- Cemil Ertürk · QuantMedia Research
- Published
- February 20, 2026
- Last material revision
- August 16, 2026
- Research version
- 1.1
- Topic
- Execution
- Review status
- Independent research. Not peer reviewed.
How to cite this research
Cemil Ertürk. "Slippage and Latency Modeling in Backtesting." QuantMedia, 2026. https://quantmedia.io/paper-slippage-latency-modeling.html
BibTeX
@misc{erturk2026slippage,
author = {Ert{\"u}rk, Cemil},
title = {Slippage and Latency Modeling in Backtesting},
year = {2026},
howpublished = {QuantMedia},
url = {https://quantmedia.io/paper-slippage-latency-modeling.html},
note = {Accessed: <date>}
}