Quant
Slippage — the cost your backtest forgets
A backtest says "buy at 100.00" and books the trade at exactly 100.00. Reality is less generous: by the time your order actually fills, the price you get is a little worse — every single time. That gap is slippage, and ignoring it is one of the fastest ways to turn a losing strategy into a great-looking backtest.
Where the gap comes from
When you send a market order, you don't buy at "the price" — you buy from whoever is selling, cheapest first. If there aren't enough shares at the best offer, your order walks up the book, filling at progressively worse prices until it's done. Your average fill ends up above the quote you saw.
Three things widen that gap:
- The bid-ask spread — you buy at the ask and sell at the bid, so you start slightly underwater on every round trip.
- Market impact — big orders move the price against themselves by consuming depth.
- Latency — between your decision and the fill, the market keeps moving; in fast conditions it moves away from you.
Why backtests quietly cheat
A naive backtest fills your order at the last printed price, with unlimited size, instantly. That's a fantasy: it assumes zero spread, zero impact, and zero delay. On an intraday strategy that trades often, even a fraction of a tick per trade compounds into a huge difference — enough to flip a "profitable" system negative once real costs are in.
The price you see quoted is rarely the price you get. Every trade pays a little toll — and a backtest that skips the toll is selling you a fairy tale.
Modelling it honestly
- Charge a realistic cost per trade — at minimum half the spread, plus fees; more for size or illiquid names.
- Fill on the next bar, not the signal bar — you can't trade on a price you only knew after it happened.
- Stress-test it — if your edge survives double the assumed slippage, it's real; if it evaporates, it was never there. (Related: your backtest is lying to you.)
Slippage isn't a rounding error — for high-frequency, small-edge strategies it's often the deciding factor. The strategies that survive contact with a real broker are the ones that were priced honestly on a laptop first.