Every team that automates trading eventually has the same conversation: "it worked in paper trading". The rules were the same, the data was the same, and the live results were worse, sometimes much worse. This is an engineering problem before it is a strategy problem. Paper trading environments and simple simulators make assumptions about execution that real markets do not honour.
This guide walks through the gaps one by one, shows how to measure each from your own live data, and how to model it so simulations stop flattering you. It is about measurement and simulation, not about which strategies to run.
Gap 1: fills at the price you asked for
Most simulators fill a market order at the last price or mid price. A real market order walks the order book: it takes the best ask, then the next level, and so on, until its quantity is filled. The average fill price is worse than the top of the book, and much worse in thin markets or during fast moves.
Measure it: for every live market order, record the mid price when the decision was made and the volume-weighted fill price. Slippage in basis points is (fill - mid) / mid * 10,000, signed by side. Plot it against order size relative to top-of-book depth.
Model it: simulate market orders against recorded order book snapshots, consuming levels; or use an empirical slippage curve by size and volatility from your live data.
Gap 2: limit orders always filling
Simulators often fill a limit order as soon as the price touches it. In reality, other orders at the same price were there first. If the price touches your level and turns back, you may not be filled at all, and the times you are filled are disproportionately the times the price kept going through your level, which is often bad for you (adverse selection).
Measure it: fill rate of limit orders by distance from mid when placed, and price movement after fills.
Model it: fill limit orders only when the price trades through the level, not when it touches it, or estimate queue position from order book data and simulate the queue.
Gap 3: partial fills
Large limit orders often fill partially. A strategy that assumes all-or-nothing fills will hold different positions than it thinks, and its follow-up logic (exits, hedges) may break.
Model it: let simulated fills be limited by traded volume at the level, and make the strategy handle partial states explicitly, as it must live.
Gap 4: fees and rebates
Taker fees, maker fees or rebates, fee discounts, and funding for perpetual futures. A strategy that trades often can be profitable before fees and unprofitable after. Paper environments sometimes charge no fees at all.
Model it: use your actual fee tier, distinguish maker and taker fills, and include funding for positions held across funding times (see our post on futures PnL and funding).
Gap 5: latency
Between the market data event that triggers a decision and your order reaching the exchange, time passes: network latency, processing time, exchange queueing. In fast markets, the price you reacted to is gone.
Measure it: timestamp each stage: exchange event time, receive time, decision time, send time, exchange acknowledgment time. The distribution of end-to-end latency, especially the tail, tells you what to simulate.
Model it: delay simulated order arrival by a sampled latency, and use market data from the delayed time for the fill.
Gap 6: market impact
Your own orders move the market, especially in less liquid pairs. Repeated orders in the same direction push prices away from you. Paper trading has no impact by construction.
Model it: for small sizes relative to volume, impact is usually negligible; above a few percent of typical volume, use conservative impact estimates or test live with small sizes and scale gradually.
Gap 7: operational failures
Rejected orders (filters, rate limits, insufficient margin), disconnects, missed fills, and downtime do not exist in a perfect simulator. Our posts on filter failures, IP bans and websocket reconnects describe how much these can change outcomes.
Measure it: count rejected and unknown-outcome orders, and time spent unable to trade.
A practical process
- Run live with minimal size for a few weeks, logging everything above.
- Fit simple models: slippage curve by size, limit fill rates by distance, latency distribution.
- Re-run the simulator with these models on the same period, and compare with live results. The gap should shrink to noise; if not, find what is missing.
- Only then use the simulator to evaluate changes, and keep comparing it with live results as conditions change.
A note on sample sizes
Execution costs vary with market conditions. A few weeks of calm markets will understate slippage for volatile periods. Keep collecting execution data continuously, segment it by volatility regime, and use the worse regimes when stress-testing simulations.
Common mistakes
| Mistake | Why it hurts | Do this instead |
|---|---|---|
| Market orders filled at mid | Ignores spread and depth | Walk the book or use measured slippage |
| Limit fills on touch | Overstates fills, hides adverse selection | Fill on trade-through or simulate queue |
| No fees or funding | Turns losers into winners | Use real fee tiers and funding |
| Zero latency | Reacts to prices you cannot get | Delay orders by measured latency |
| Ignoring rejections and downtime | Overstates time in market | Track and simulate operational failures |
Key takeaways
- Simple simulators assume perfect execution; real markets charge for every assumption.
- Measure slippage, fill rates, latency and fees from live data.
- Model limit fills conservatively and include adverse selection.
- Calibrate the simulator against a live period before trusting it.
- Treat execution modelling as engineering work with tests and data.
References
- Binance Spot API, order types and time in force — https://developers.binance.com/docs/binance-spot-api-docs/enums
- Almgren and Chriss, Optimal Execution of Portfolio Transactions (Journal of Risk, 2001) — https://doi.org/10.21314/JOR.2001.041
- Kissell, The Science of Algorithmic Trading and Portfolio Management (overview) — https://www.sciencedirect.com/book/9780124016897/the-science-of-algorithmic-trading-and-portfolio-management
Comments
0No comments yet. Be the first to comment!
Sign In to post a comment.