Backtest Fill Assumptions: Why Market, Limit and Stop Orders Change Strategy Results
Backtest fill assumptions determine which historical prices a strategy is allowed to trade at. An entry signal is not a fill: market orders face spread and slippage, limit orders may never execute, and stop orders can trigger without receiving the stop price. Unrealistic fills can turn a losing strategy into a profitable-looking backtest.
The difference between a signal and an executable order
A bar closing above a breakout threshold tells a strategy that a condition was met. It does not establish that a buy could have been executed at that same closing price after the signal was known. The earliest eligible fill depends on data timestamps, decision latency, order type, market hours, available liquidity and the broker or venue’s rules.
Market orders: use the executable side of the spread
Suppose a stock shows bid £99.98 and ask £100.02. A market buy of 100 shares at the displayed ask costs £10,002 before commission. Valuing the entry at the £100.00 midpoint understates the entry cost by £2. If the average realised execution is £100.05, the difference from the midpoint becomes £5. The fill can also vary with order size and depth.
Limit orders: touching the price does not guarantee a fill
A buy limit at £100.00 means do not pay more than £100.00, but it does not guarantee execution. A one-minute candle with a low of £99.99 does not reveal whether sufficient sell volume traded at your price after the order arrived, or how much queue priority you had. A credible model should test conservative non-fill assumptions and account for the opportunity cost of missed trades.
Stop orders: trigger price is not execution price
Suppose a protective sell stop is set at £98.00 on 100 shares. If the market gaps from £99.00 to an executable bid of £96.50, a conventional stop-market order may sell near £96.50, subject to liquidity and venue behaviour. Relative to the £98.00 stop level, that is £150 more loss on 100 shares. Stop-limit orders constrain acceptable price but can remain unfilled during a gap.
Intrabar ambiguity and bar-resolution limits
If one OHLC candle touches both a stop and profit target, the candle alone does not show which occurred first. Assuming the target filled first systematically favours the backtest. Use higher-resolution data where available, a documented conservative tie-break rule, or exclude ambiguous cases from headline claims. Higher resolution still does not recreate every queue position or hidden order.
Latency, liquidity and market impact
Test the delay from signal observation to order submission and from submission to acknowledgement. Model bid–ask spread changes, partial fills and volatility-dependent slippage. Larger orders may move prices or consume several levels of depth. For illiquid stocks, a quoted best price for a small displayed quantity is not necessarily the price for the full intended trade.
A defensible fill-sensitivity test
Run at least three scenarios: optimistic but executable, central realistic and stressed. For example, if a strategy makes 200 round trips per year with £2 average extra execution cost per round trip, the annual reduction in net P&L is £400. At £5, it is £1,000. Compare these differences with the original expected edge, not just the gross return.
Where both a stop and target are touched in the same historical candle, the bar’s OHLC values cannot establish which executed first. Use suitably granular historical data or explicitly report conservative and optimistic scenarios; avoid silently selecting the more profitable order sequence.
For a broader approach to testing trading ideas against realistic assumptions and alternative explanations, explore the Trade Idea Generation Masterclass.
Operational checklist before trading live
Document signal timestamp, order type, trading session, bid/ask source, expected latency, volume constraints, spread, commissions, financing, stop and target ordering, rejected orders and partial fills. Compare simulated fills with a small sample of actual demo or live fills where permitted. Do not use favourable fill assumptions simply because they make the equity curve smoother.
Related learning: Purged cross-validation and data leakage; Traders MBA Education knowledge base. Further reading: scikit-learn cross-validation documentation, Investor.gov: market orders, and Investor.gov: limit orders.
Educational material only. Illustrations are hypothetical, not investment recommendations or evidence of future results.
Stay Ahead of the Markets
Get market analysis, financial news and practical trading insights delivered straight to your inbox.