Queue Position & Fill Probability Primer (2026-02-21)
Why this matters
If your strategy leans on passive limit orders, your edge depends on one hidden variable: where you are in the queue. Backtests that ignore queue dynamics usually overestimate fills, underestimate adverse selection, and inflate Sharpe.
Core idea in one line
At a fixed price level, your fill chance over horizon (T) is mostly a function of:
- volume ahead of you,
- trade flow hitting your side,
- cancellations/modifications in front of you,
- your latency (insert/cancel/replace).
Practical modeling ladder
Level 0 — naive (don’t trust in production)
- Assume best bid/ask touch => immediate/guaranteed fill.
- Good for toy strategy debugging only.
Level 1 — queue-depletion heuristic
- Track volume ahead at entry.
- Decrease it by observed trades at that level.
- Optionally assign a probability that non-trade size decreases happened in front of you.
- Fill when estimated volume ahead <= 0.
Level 2 — state-dependent stochastic model
- Model order flows (limit/cancel/market) as state-dependent intensities.
- Compute fill probability before timeout or before opposite quote/mid changes.
- Better for realistic execution-risk optimization.
Level 3 — live-calibrated simulator
- Use exchange-specific latency + queue rules + your own live fill logs.
- Recalibrate frequently by venue/regime (quiet, trend, high-vol).
- Compare backtest fill curves vs production fill curves by bucket.
A robust implementation pattern
Initial queue estimate
- On order send/ack, estimate ahead volume from market-by-level snapshot.
Event-time update
- For each depth update at your level:
- trades reduce ahead volume deterministically,
- non-trade reductions (cancels/modifies) reduce ahead volume probabilistically.
- For each depth update at your level:
Probabilistic split for non-trade reductions
- Use a function (p) mapping your estimated position within queue to probability that a cancel happened before you.
- Calibrate (p) from your own fills, not generic assumptions.
Outcome labels
- filled / partially filled / canceled / expired.
- Keep horizon-specific metrics (e.g., 250ms, 1s, 5s).
Diagnostics
- Reliability plots: predicted fill probability vs observed fill rate.
- Error by volatility regime and spread regime.
Common failure modes
- Using one global model across venues: queue behavior differs massively by matching engine and participant mix.
- Ignoring feed/order latency asymmetry: stale queue estimates create phantom fills.
- No partial-fill accounting: binary labels hide meaningful execution risk.
- Not retraining after market structure drift: maker programs and participant composition change.
Minimal KPI set for production sanity
- Fill-rate MAE (predicted vs realized)
- Time-to-first-fill quantiles
- Cancel-to-fill ratio by signal strength bucket
- Slippage decomposition: spread capture vs adverse move after fill
- Backtest-to-live fill gap (weekly)
Notes from literature & practice
- Queue position materially changes expected value of passive orders; farther back means lower execution probability and often worse economics once adverse selection is included.
- State-dependent queueing frameworks can produce tractable, useful fill probability estimates without requiring full micro-level agent reconstruction.
- In practice, simple queue models can already improve backtest realism if calibrated against your own venue-level fills.
Sources
- Rigtorp, Estimating order queue position (practical market-by-level heuristic)
- hftbacktest docs, Probability Queue Position Models (simulation impact + calibration perspective)
- Huang, Lehalle, Rosenbaum (2013/2014), The queue-reactive model (state-dependent order flow framework)
- Yu, et al. (2024/2026), Fill Probabilities in a LOB with State-Dependent Stochastic Order Flows
- Moallemi & Yuan, A Model for Queue Position Valuation in a Limit Order Book (queue value / execution economics)