Quant
Did that fill even happen?
Almost every backtest engine contains the same innocent line: if the price traded at or through my limit, I was filled. It's simple, it's fast, and it's wrong in a way that manufactures profit out of nothing. Touching a price is not the same as getting filled at it — and the difference isn't random. It's biased directly against you.
Touch is not fill
Say you place a bid for 100 shares at 100.00. The price dips, 500 shares trade at 100.00, and the price bounces. Your backtest sees a print at your limit and marks you filled. But the market is a queue: those 500 shares went to the orders that arrived before yours. If 700 shares were already resting at 100.00 when you joined, the tape printed at your price and you got nothing.
The bias that actually hurts
Missing fills would be survivable if they were random. They aren't, and this is the part worth internalising: limit orders fill you precisely when you're wrong.
Think about when your resting bid at 100.00 actually gets done. It gets done when enough sellers come through to exhaust the whole queue — that is, when the price is genuinely pushing down through your level. You get filled, and then it keeps falling. When the price merely kisses 100.00 and rebounds — the scenario where your bid would have been brilliant — the queue absorbs the flow and you're left standing.
That's adverse selection. Your real fills are a biased sample of the fills your backtest imagined: skewed toward the trades that go against you. A backtest that fills on touch doesn't just overstate your fill rate; it hands you the good half of a distribution and throws away the bad half.
Backtest: "the price touched my order, so I bought." Reality: a queue of people got there first, and you only reach the front when the price is blowing through your level — which is exactly when you didn't want it.
Market orders are honest, limit orders are optimistic
Market orders have the opposite property: they always fill, so there's no fantasy about whether — only about where. You pay the spread and, if you're big enough, market impact. That's a cost you can measure and model, which is what slippage is about. It's an unpleasant number but an honest one.
Limit orders make the cost disappear and replace it with a much sneakier lie about fills. Which is why a backtest full of limit fills is far more dangerous than one full of market orders paying spread — the second is pessimistic and knowable, the first is optimistic and invisible.
Fill rules that don't lie
You can't model the queue perfectly without full order-book data and a matching engine. You can be conservative:
- Require trade-through, not touch. Only fill your bid if the price traded strictly below your limit — evidence the queue at your level was cleared out.
- Assume you're last in queue. Require the volume at your level to exceed some multiple of your size before granting a fill.
- Cap participation. Never let yourself take more than a few percent of a bar's volume. If your 10,000-share order sits in a bar that traded 2,000, you did not get filled — and your backtest just invented liquidity.
- Model partial fills. Real orders come back 40% done. If your logic can't express "I'm partly on", it's not describing anything that can happen live.
- Sanity-check with market orders. Re-run the strategy filling everything at market with realistic spread. If the edge only exists with limit fills, your edge is the fill assumption.
Getting fills right is where backtesting stops being data analysis and starts being a simulation of a market that has other people in it. It's also the last thing your backtest can teach you — everything past this point you learn by placing small real orders and comparing, which is what the deployment ladder and a proper execution engine exist to do. Until then, treat every limit fill in your results as a claim requiring evidence, and remember which order type you're actually willing to defend.