Guide · Execution & Fills

How backtest order fills, gaps and slippage work

A backtest is only as honest as its fill engine. If a simulator fills stops at the trigger price during a gap or assumes your limit filled on a 15-minute bar without checking 1-minute order flow, your equity curve is fiction.

Updated

1-minute matching regardless of chart timeframe

Even if you trade on a 15-minute, 1-hour or 4-hour chart, Charts Replay evaluates every resting order against the underlying 1-minute bars before drawing them. An order placed on a 4-hour chart fills in the exact minute price reached it, and fast playback (up to 20×) never skips a bar.

How backtest order fills, gaps and slippage work — Charts Replay 1-minute true-price order matching and fill simulation screenshot
Charts Replay 1-minute fill engine: limit, stop and bracket orders are matched against underlying 1-minute true traded prices across all 15 timeframes.

Limit vs stop vs gap-open rules

  • Every one-minute bar is matched before it is drawn, whatever timeframe is on screen — an order placed on a 4-hour chart fills in the minute price actually reached it.
  • Limits fill when price reaches them; stops fill when price crosses them.
  • Gaps are priced against the bar’s open: a buy limit gapped through fills at the better open, a stop gapped through fills at the worse open plus slippage.
  • When several orders trigger in the same bar, stops match before limits.

Concrete ES fill examples on a 1-minute bar

ScenarioResting order1m bar (O / H / L / C)Simulated fill price
Normal limit fillBuy limit at 5,800.005,802.00 / 5,803.00 / 5,799.50 / 5,801.505,800.00 (price reached limit)
Gap-through buy limitBuy limit at 5,800.005,796.00 / 5,798.00 / 5,795.00 / 5,797.005,796.00 (favorable open)
Gap-through sell stopSell stop at 5,790.005,786.00 / 5,787.00 / 5,784.00 / 5,785.505,786.00 minus slippage (worse open)
Both TP & SL inside 1m barLong with SL 5,796 / TP 5,8045,800.00 / 5,805.00 / 5,795.00 / 5,802.005,796.00 (stop matches before limit)

Why stop-before-limit matters

Inside a single 1-minute bar, historical OHLC data records the high and low but not whether the high printed before the low. When both a protective stop and a take-profit limit sit inside the same 1-minute candle, optimistic simulators assume the target hit first. Charts Replay takes the conservative path: stops match before limits, so your backtest never relies on lucky intrabar sequencing.

Commissions and slippage

Set realistic round-trip commissions per session ($2.50/side in the daily challenge; $1.75 ES/NQ and $2.30 GC in CR FLEX 50K, or $0.61/$0.96 for micros). For breakout strategies using stop entries, remember that fast opens and news candles can gap through your stop price and fill at the worse open plus slippage.

Frequently asked questions

Does a limit order fill if price only touches the exact limit price?

Yes — limits fill when 1-minute price reaches the limit price, and gap-through buy limits fill at the better open price.

Why does Charts Replay match stops before limits in the same bar?

Because 1-minute OHLC bars do not record intrabar tick order. Matching stops first prevents artificially inflated win rates on tight-stop strategies.

Backtest it on real ES, NQ, GC, BTC & ETH data

One-minute history, resting orders that have to be reached, and every trade kept for review. 7 days free with Google or Discord sign-up, no card required.

Start backtesting