Limit Order Fill Probability
A backtest that fills a limit order the instant the market "touches" its price is assuming you were first in line. In real markets you are behind everyone who queued before you, and touching a price is not the same as trading through your size.
Prerequisites: Market vs. Limit Orders
The simplest way to backtest a limit order is: if the bar's low is at or below the limit price on a buy, the order fills. That rule assumes two things that are rarely true — that you were the very first order resting at that price, and that reaching the price with the tape means trading through your entire size. Neither holds in a real order book, where you queue behind everyone who arrived earlier at that price level and the market only trades through part of the book before reversing.
Worked example: touch is not fill
A strategy wants to buy 10,000 shares with a limit at the current bid. Over the next bar, the price does trade down to that level — the naive "touch = fill" backtest marks the full 10,000 shares filled at the limit price, no slippage, no cost.
What actually happened at that price level: 60,000 shares of resting buy interest were already queued ahead of the order (the bid had been sitting there for a while), and only 45,000 shares traded through the level before price moved back up. The order never reaches the front of the queue — it gets zero fill, not a full fill.
Now soften the assumption to a realistic queue model: fill probability scales with how much volume traded through the level relative to the resting size ahead of you,
Plugging in: 45,000 / (60,000 + 10,000) ≈ 64%, so a realistic simulation fills roughly 6,400 of the 10,000 shares, not all 10,000 and not zero.
| Model | Fill assumption | Shares filled | Backtest Sharpe |
|---|---|---|---|
| Touch = fill | Any touch fills 100% | 10,000 | 2.0 |
| Queue-aware | Volume-through vs. queue-ahead | ~6,400 | 1.3 |
| Conservative (last-in-line) | Fill only if fully through queue | 0 | (order never fills) |
The three models don't just differ by a scaling factor — the queue-aware one also delays when the fill happens relative to the signal, since the order sits resting while price moves, changing which trades even count as "in the market" when the signal decays.
"The price touched my limit" and "my order filled" are different claims. Model fill probability from volume traded through the level relative to the size resting ahead of you, and treat a bare touch as evidence of a partial fill at best, not proof of a complete one.
The bias always runs one way: touch-fill backtests overstate fills, which overstates realized edge, and the overstatement is worst for passive, contrarian strategies that place limits at levels the market is reluctant to trade through — precisely the strategies most likely to be built and shown around this bug.
Where queue position data isn't available, a defensible proxy is to require the bar's traded volume at that price to exceed some multiple of the order size before granting any fill, and to fill only the fraction implied by that ratio.
Practice in interviews
Further reading
- Cont, Kukanov & Stoikov, The Price Impact of Order Book Events