At 17:42 on Friday, a developer is staring at a dashboard after a bad week. The strategy is up in the backtest, flat in paper trading and down in the live account. The paper log shows every limit order filled at the touch. The live log shows missed queues, partial fills and fees the simulator never charged.
Start with the order path
A useful paper venue simulates the path from decision to execution, not just the next price. A buy limit at the current offer is not automatically filled because the market traded there. It joins a queue, and it may sit behind other orders until enough volume trades at that price. If the quote moves first, it may never fill.
Write down what the target venue actually supports before building a fill model. Record its tick and lot sizes, order types, trading sessions, time-in-force rules, fee schedule and rejection conditions. Include operational details such as acknowledgement delays, cancel-replace behaviour and the response to duplicate client order IDs.
- Use bid and ask data, not only candle closes. A bar cannot tell whether a limit order was executable before the price moved.
- Represent partial fills as separate events. Preserve the remaining quantity and its queue position after each fill.
- Charge maker and taker fees separately, including minimum commissions and rebates where applicable.
- Model rejects for invalid size, stale prices, closed sessions and insufficient buying power.
- Make the simulated event stream match the live API shape, including timestamps, order IDs and error fields.
These choices affect strategy logic. A bot that assumes a full fill may send a hedge for inventory it does not hold.
A bot that treats a timeout as a rejection may resubmit an order that was accepted but whose acknowledgement was lost. Paper trading should expose those state transitions, not conceal them behind a single filled flag.
Choose a fill model that admits uncertainty
There is no single realistic fill rule for every product. A market order can be modelled against the available book, while a passive limit order needs a queue assumption. If full depth is unavailable, use a conservative proxy: require traded volume at the limit to exceed estimated volume ahead of the order before assigning a fill.
Do not present that estimate as venue truth. Queue position depends on hidden liquidity, cancellations and matching priority.
A practical simulator can run several assumptions, such as 25%, 50% and 100% of observed volume ahead remaining in the queue, then show how strategy performance changes. If the edge vanishes under a modestly adverse assumption, that is useful information.
A fill model should make uncertainty visible, not convert it into a guaranteed fill.
Use typical market ranges as sanity checks, not universal constants. The figures below describe small orders in liquid instruments during ordinary conditions. Volatility, venue, size and time of day can move results well outside them.
| Market and order size | Typical quoted spread | Typical market-order slippage | Useful simulation detail |
|---|---|---|---|
| US large-cap equities, 100-500 shares | 1-5 basis points | 0-5 basis points | Lot size, routing delay and partial execution |
| Major FX pairs, 10,000-100,000 units | 0.1-1.0 pip | 0-1.5 pips | Variable spread and reject or requote behaviour |
| Front-month index futures, 1-5 contracts | 0.25-1 tick | 0-2 ticks | Tick value, queue priority and session breaks |
| Top crypto spot pairs, $1,000-$10,000 | 1-10 basis points | 1-20 basis points | Book depth, fee tier and rate limits |
Use a book walk for market orders when depth data is available. For larger orders, estimate impact from consumed levels rather than applying one fixed slippage figure.
For passive orders, report both an optimistic touch-fill result and a queue-adjusted result. Keeping the two separate makes it harder for a favourable assumption to pass as a measured fill.
Match timing, state and failure modes
Price realism is not enough for an unattended agent. The agent observes data, makes a decision, sends a request and receives an acknowledgement later.
Simulate that sequence with timestamps. A typical API round trip may be tens to hundreds of milliseconds, but network conditions, location and load can push it higher. Use measured latency distributions from the intended deployment path where possible.
Feed delay matters too. Replay events in the order the agent would have received them, including delayed or out-of-order updates if the live feed can produce them.
Apply a stale-data rule, such as refusing new orders when the last valid quote is more than 500 milliseconds old for a fast intraday strategy. The right threshold depends on the market and decision interval.
Test the awkward state transitions explicitly:
- An order is accepted, but the acknowledgement times out. The agent checks status before retrying.
- A cancel request races with a fill. The final state can be partially filled, cancelled, or fully filled.
- A rate limit blocks an order. The agent backs off rather than retrying on every loop.
- A reconnect produces a position mismatch. The agent reconciles from venue state before sending more orders.
Use idempotent client order IDs and persist the agent's intended order state. In simulation, inject timeouts, disconnects and duplicate events. A clean run with stable connectivity does not test whether recovery logic is safe.
Calibrate against live observations
Compare the simulator with small live orders or shadow orders, where the system records intended orders without submitting them. Shadow orders help measure decision timing and hypothetical prices, but they cannot prove queue fills. For that, a limited live sample is more informative, subject to account permissions and risk controls.
Track distributions, not just average slippage. For each product and order type, compare predicted with observed spread paid, fill rate, time to fill, partial-fill rate, reject rate and fees.
Break results out by size, time of day and volatility. A mean error near zero can hide a model that is too optimistic on half the orders and too pessimistic on the rest.
- Collect at least several hundred order observations per product and order type before drawing a stable comparison. Treat smaller samples as provisional.
- Measure fill-probability calibration in buckets. If orders assigned a 60% fill probability fill only 35% of the time, adjust the model and preserve the old version for comparison.
- Set tolerances before reviewing results. For example, flag a paper-to-live median slippage gap above 1 basis point in liquid equities, or above 0.5 pip in a major FX pair.
- Replay the same decisions with live timestamps and costs. Separate strategy changes from simulator changes so a better result cannot be explained by both at once.
- Repeat after venue, fee, routing or data-feed changes. Version the assumptions alongside the strategy and market data.
Those thresholds are starting points, not exchange standards. Set them to the strategy's expected edge and the instrument's normal cost range. If expected profit per trade is 2 basis points, a 1 basis-point model error is material. If the strategy targets a much larger move over several days, the same error may matter less.
Gate unattended deployment on evidence
Use paper trading to test the full agent loop: market data, decision code, risk checks, order submission, recovery and reconciliation. Set a minimum observation period and a release gate based on the strategy's turnover.
A high-frequency system may need thousands of order events across market conditions. A low-turnover system may need weeks to observe enough executions.
A sensible release checklist includes:
- No unexplained position or cash mismatches during the test window.
- Order state is reconciled after restart, timeout and reconnect tests.
- Observed or conservatively estimated costs leave the strategy above its minimum edge threshold.
- Rejects, partial fills and stale data trigger defined responses rather than repeated order attempts.
- Position limits, loss limits and a kill switch work independently of the strategy process.
Keep a separate record of simulated assumptions and measured outcomes. Review the gap after any change to order logic.
A hosted agentic paper-trading environment can also help exercise the order loop without building every operational component from scratch. Agentic Trading Index offers agentic paper trading from $9.99 a month through its paper-trading platform.
This playbook does not apply unchanged to products whose execution is negotiated or materially bespoke, such as some OTC instruments. Their liquidity, pricing and fill conditions may not be observable enough for a generic venue simulator to represent reliably.
Frequently Asked Questions
What makes paper trading realistic?
It models the order lifecycle, including queueing, partial fills, fees, latency, rejects and cancels. It also exposes uncertainty instead of filling every order that touches a quoted price.
Can paper trading predict live fills?
It can estimate fill probabilities if its assumptions are calibrated against suitable live observations. It cannot guarantee queue position or reproduce hidden liquidity exactly.
How many orders are needed to calibrate a simulator?
Several hundred observations per product and order type provide a useful initial comparison, though results remain provisional. High-variance strategies need larger samples across different market conditions.
How should a simulator handle limit orders?
It should account for price-time priority and estimated volume ahead, then represent partial fills as separate events. If depth or queue data is unavailable, use conservative assumptions and show sensitivity to them.
When is paper trading not enough?
It is not enough when execution depends on negotiated prices, hidden liquidity or venue-specific conditions that the simulator cannot observe. A controlled live test may be needed, subject to account permissions and independent risk limits.