The Quote Is Not the Fill
Suneet Malhotra
Sep 01, 2026
A limit order in a backtest is usually treated as a price condition. If the market traded at or through the limit, the simulator marks the order filled.
That is a useful first approximation. It is not an execution model.
The missing variable is time. A strategy observes a quote, computes a signal, constructs an order, sends it through a network, reaches a venue, and waits behind orders that arrived earlier. The price in the data is a statement about what traded. It is not a receipt proving that my order traded.
This distinction matters because the most attractive fills are often the least available fills.
The race starts before the order exists
Suppose a strategy sees an ask at 100.00 and submits a buy limit at 100.00. A bar-based backtest may see a low at 100.00 and mark the order complete. The live sequence contains more states:
- The quote was 100.00 at observation time.
- The signal and sizing code consumed time.
- The order reached the venue.
- Earlier orders already occupied the queue.
- Displayed quantity changed before arrival.
- A trade printed at 100.00, consuming only the queue ahead.
- The market moved away, leaving my order unfilled.
The historical print validates that someone traded at 100.00. It does not identify the queue position or the quantity available to a new order.
A flat slippage number does not fully repair this. Slippage answers a price question: conditional on a fill, how far from the reference did execution occur? Queue position answers a participation question: did execution happen at all?
Those are different random variables.
The attractive fill is selected
An order that fills immediately may have met resting liquidity in a quiet book. An order that fails to fill may have carried a correct signal but arrived during a fast move. Dropping the second group creates a selection effect.
The missing trades are correlated with the path that produced the signal. Momentum signals are especially exposed: when the market moves toward the intended entry, the displayed offer can disappear, reprice, or become a queue that the order never reaches.
The backtest reports the returns of a strategy that participated in the historical move. The live strategy may participate only when the move is less urgent. That changes the distribution of entries.
The same logic applies to exits. A stop price is a trigger, not a guaranteed settlement. If a bar crosses the stop, the simulator needs a rule for executable price, available liquidity, and order type. Otherwise the loss distribution is compressed precisely where the market moves fastest.
What the simulator should record
I do not need a perfect exchange replica. I need to preserve the variables that the shortcut erases.
An execution experiment should record quote and decision timestamps, order submission and venue acknowledgement timestamps, side, limit price, displayed and requested size, marketable versus resting status, queue estimate, partial fills, time in force, reference price at decision and arrival, execution price, cancellation reason, and order age.
With those fields, the strategy can be tested under explicit assumptions. A conservative model can require the market to trade beyond the limit. A queue model can fill only after observed volume plausibly consumes the size ahead. A latency experiment can replay the same signal with 10, 50, and 200 milliseconds added before arrival.
The output should include more than P&L. Compare fill rate, participation rate, time to fill, adverse excursion after submission, missed-move rate, and the conditional return of filled versus unfilled signals.
The unfilled row is part of the strategy. It is not a logging nuisance.
The practical rule
When reviewing a backtest, I ask two separate questions:
- Could the market reach this price?
- Could this order reach the front of the queue before the opportunity disappeared?
The first belongs to the price path. The second belongs to the event path.
A candle contains the first imperfectly and the second almost not at all. Tick data improves timing, but even tick data cannot reveal queue position without a model for order arrival and displayed liquidity. More granular data is not automatically more realistic. It can simply make a precise record of an incomplete assumption.
The cleanest test is an ablation. Run the same strategy with optimistic fills, conservative fills, and a latency-aware fill model. If the thesis survives only under the optimistic case, the strategy has not been validated. The fill assumption is carrying the edge.
The quote is an observation. The fill is an event with competition, delay, and partial information. A reliable execution model keeps those concepts separate. Otherwise the backtest is not asking whether the strategy could trade. It is asking whether the historical tape ever printed a price that would have made the trade look good.
Share this post
You Might Also Like
A Retry Is Not a Trading Decision
A rejected order is a decision. Retrying it without preserving the reason can turn a risk control into a duplicate trade.
Quantitative TradingThe Market Is Closed Is Not a Trading Rule
A backtest can know the exchange hours and still schedule a trade into a holiday, an early close, or a stale session. Calendar state is market data.
AI & AutomationReplay the Decision, Not the Answer
Agent tests that compare only final answers miss the failure that matters: the same input can produce a different tool choice, path, or refusal before the answer changes.
AI & AutomationAI Infrastructure 101 for QA Engineers: From a Prompt to a Test Result
AI infrastructure for QA engineers: understand the path from data center, GPUs, memory, and networking to model execution and reliable LLM evaluation.
Latest Blog Posts
Replay the Decision, Not the Answer
Agent tests that compare only final answers miss the failure that matters: the same input can produce a different tool choice, path, or refusal before the answer changes.
AI Infrastructure 101 for QA Engineers: From a Prompt to a Test Result
AI infrastructure for QA engineers: understand the path from data center, GPUs, memory, and networking to model execution and reliable LLM evaluation.
The Record Cannot Authorize the Fix
A failure log can preserve the facts and still leave the system unchanged. The missing field is not more context. It is authority.
Related Tools & Demos
The QA Field Manual to Language Models
A free 24-chapter book. Start at βwhat is AI, really?β and finish with a small language model you built yourself β one that reads a failing Playwright test and proposes a fix you can run. Read it in your browser, or download the PDF or the Mac app.
View Source Code βMulti-Model LLM Harness
One interface to call any AI model β capability routing, fallback chains, budgets, circuit breakers, and a quality feedback loop. A practical architecture pattern write-up.
Automated Trading System
Multi-engine trading platform with real-time risk management, regime-based strategy selection, and automated order execution.
View Source Code β
Stay in the Loop
Get weekly insights on AI-driven QA, engineering leadership, and automation strategies.
No spam, ever. Unsubscribe anytime.