Skip to content

Fill model

Your strategy can evaluate on any timeframe, but a backtest fills its orders on finer data. That is 1-minute candles, and for crypto symbols with recorded order books, the books themselves: market orders and stops are priced on the book. Where books exist, a stop or limit that the price reaches during a minute is also timed on that minute's recorded trades, on every plan. For windows without books, the Tick fills setting (Trader and Quant) turns that trade timing on.

One-minute fills

These rules apply to stocks, FX, and crypto minutes without a recorded book.

  • Market orders fill at the next minute's open, plus slippage.
  • Gaps: a stop or limit that the price has already passed at a minute's open fills at that open.
  • Stops and limits reached during a minute (the minute's high or low touches the price) fill at the next minute's open. A stop fills at that open plus stop slippage. A limit fills at its own price as a maker fill, never better, even when the next open is past it.
  • Stop-loss and take-profit in the same minute: a candle can't show which price came first, so the stop-loss is assumed to fill first.

A 1-minute candle only has an open, high, low and close. So a stop that a short wick reaches waits for the next open. That open often comes after the price has bounced back, which can make the stop's fill look better than it would have been.

Order-book fills

Crypto backtests price market orders and stops on recorded 1-second order books (50 price levels a side) wherever the books exist. This is on by default and has no setting.

  • Market orders fill at the minute's open against the last book captured before that open. The order takes the book's levels, best price first, until it is filled, and pays the average price as a taker. If no book was captured in the minute before the open, the order uses the 1-minute rule.
  • Stops gapped at the open fill the same way as market orders.
  • Stops reached during a minute are timed on that minute's recorded trades and priced on the book (see Tick fills). Only a minute without usable trades falls back to the books alone: the stop (the minute's candle traded at the stop price) fills on the first 1-second book in that minute whose best bid (for a sell stop) or best ask (for a buy stop) is at or through the stop price. The fill happens at that book's time. If the price crossed the stop after you placed it, the fill is at the stop price plus the cost of walking that book's depth; otherwise it is the average price of walking the book. Either way it is never better than the stop price. A book alone does not fill a stop: a trade must have reached the stop price.
  • If the price moved through the stop between two books, the candle shows the stop was reached but no 1-second book does. The stop then fills at the minute's close, at its own price, or at the close if the minute closed past it, plus the cost of walking the depth of the minute's book that came closest.
  • Limit orders fill at their own price, as with 1-minute fills, never better. A limit placed during a minute (such as the take-profit of an entry that filled on a book) can fill later in that same minute, on the first 1-second book that crosses its price, if the candle also traded there.
  • Slippage is not added to a book fill, because walking the book already is the price impact. The slippage named in a result's cost line applies only to fills that fall back to the 1-minute rules.
  • A fill only uses a book captured at or before the fill's time.

If an order needs more depth than the book offers, the result counts it. The rest is priced by extending the book's own depth past its last level, so it costs more the further it goes. A stop only takes the levels at or past its own price, so it can run out sooner. When you place a limit or stop on a symbol whose price step we know (0.1 for BTCUSDT, for example), its price is put on that step: a limit at or inside its price (a buy limit rounds down, a sell limit up), a stop at or past it (a buy stop rounds up, a sell stop down). A minute without a book uses 1-minute fills, and the result counts that too. If the books show that the account could have been liquidated before a stop's fill, the rest of that minute uses 1-minute fills.

Market orders read books the run already has. A minute where the price reaches a stop or limit loads that minute's trades, and a stop also loads its books. On our production servers a minute's books take a median of about 8 milliseconds to load and its trades about 20 milliseconds (90% within 60). So runs with many stop and limit fills take longer: on our built-in strategies (BTCUSDT, 15m, four and a half months) the added time ranged from under a second to about 6 seconds a run. The slowest, with about 190 such minutes, took about 68% longer than without trade and book fills. A run loads the books of up to 3,000 such minutes; past that, later stops use 1-minute fills and the result says the limit was reached. If a minute's books can't be loaded (the market-data server is unreachable, even after one retry), that minute and every later stop use 1-minute fills, and the result names the minute.

Symbol Books from How often
BTCUSDT 2023-01-18 about every second, except about every 10 seconds from 2026-02-16 00:00 to 2026-04-11 14:07 UTC
ETHUSDT, SOLUSDT, XRPUSDT, DOGEUSDT April 2025 about every second
Other crypto symbols, stocks and FX none

Some months have short gaps (most months have a book in over 99% of their minutes). In the BTCUSDT period with books about every 10 seconds, a fill can use a book up to 10 seconds old, so book fills there are less precise. On our built-in strategies (BTCUSDT, 15m, December 2025 to April 2026), market orders filled a median of 0.025% (2.5 basis points) better than with the default slippage.

Tick fills

Tick fills time stops and limits on recorded trades. Where the symbol and window have recorded books, this is on for every backtest, whatever the Tick fills box says. Elsewhere it is the Tick fills setting (see Turning it on).

Tick fills only change minutes where the price reaches a resting stop or limit. In those minutes the order fills on the minute's recorded trades:

  • Stops fill on the first trade at or through the stop price, at that trade's time, instead of waiting for the next minute's open. Where a 1-second book exists, the price comes from the book captured at or before that trade, using only the levels at or past the worst price traded at that moment; if that book has none, the stop fills at that worst price plus the cost of walking the book's depth. Without a book, the stop fills at the trade's price plus the usual stop slippage.
  • Limits fill at their own price on the first trade that touches it, as a maker fill. The price is the same as with 1-minute fills, but the fill happens during the minute rather than at the next open.
  • Stop-loss and take-profit: the one the trades reach first fills. Only when both are first reached by trades with the same timestamp is the stop-loss assumed to fill first.
  • Timing: an order only fills on trades at or after the time it was placed. A stop-loss or take-profit attached to an entry that filled on a trade can fill on later trades in the same minute, but never on the trade that filled the entry.

Trades with the same timestamp are handled as one group, because their order inside the same millisecond isn't known.

Everything else works as it does with 1-minute fills: market orders, gap fills at the open, order-book fills of market orders, fees and slippage, mark prices, liquidation checks, trailing stops, break-even moves, maximum hold time and funding. An order still fills in full. Your strategy code never sees the trades: it gets the same candles either way.

If the trades show that the account could have been liquidated before a fill, the rest of that minute uses 1-minute fills. The result counts these minutes.

What changes in practice. On our built-in strategies (BTCUSDT, 15m, December 2025 to April 2026), with trades and books on by default, stops filled a median of 0.15 to 1.2 basis points past their level (90% within 2.3), against 3.5 to 16 with the 1-minute rule. Limits filled at their own price as maker fills, a median of 24 to 36 seconds before the next minute's open. The order of a stop-loss and take-profit can only change when they sit close enough together for one minute to reach both.

Where trade data exists

Symbol Trades from
BTCUSDT 2016-05-01 (before 2020-03-25 these are BitMEX XBTUSD trades, another exchange's inverse contract, still charged Bybit's fees)
ETHUSDT 2025-04-11
SOLUSDT 2025-04-12
DOGEUSDT 2025-04-13
XRPUSDT 2025-04-17
Stocks and FX none

A minute without trade data uses 1-minute fills, and the result counts it. The same goes for a minute whose trades can't be loaded: it and the rest of the run use 1-minute fills, and the result names the minute. A stock or FX backtest with tick fills on therefore runs exactly as with 1-minute fills, and its result says so. A crypto window that starts before the trade data uses 1-minute fills until the data begins; those minutes don't count toward the per-run limit.

Per-run limit

A run can look up the trades of up to 3,000 minutes or read up to 30 million trades, whichever comes first. A minute that had no trade data counts toward the 3,000. Past the limit, the rest of the run uses 1-minute fills and the result says the limit was reached. In our tests a six-month hourly BTCUSDT backtest needed between 11 and 95 such minutes.

Each of those minutes loads its trades, so trade timing makes a run slower; see Order-book fills for how much.

Forward walks

Order-book fills and tick fills apply to the out-of-sample legs of a forward walk. Like a backtest, a leg whose symbol and window have recorded books times its stops and limits on trades on every plan; the Tick fills box covers the legs without books. The in-sample parameter search keeps 1-minute fills, and so does the Lab. A forward walk on the 1m timeframe gets no tick fills, and its result says so.

The WFO efficiency compares each window's in-sample result with its out-of-sample result. So that both sides use the same fills, the walk re-runs the selected parameters once on the in-sample window with the out-of-sample fill model and uses that result for the in-sample side. A window whose in-sample search already used the same fills (no recorded books and no tick fills) needs no re-run.

Paper trading doesn't use these fill models. It has its own execution modes, described in How paper fills differ from backtests.

Turning it on

Order-book fills have no setting. Where a crypto symbol and window have recorded books, stops and limits are also timed on trades on every plan, with no setting.

For other windows, tick fills are part of the Trader and Quant plans and are off by default. For a backtest, the Tick fills box is under Advanced in the run settings. For a forward walk, it is under Anchored mode in the forward-walk dialog. On the Free plan the box is locked.

Reading the result

A crypto backtest with order-book fills shows a line like this on its results page:

Order-book fills: 222 market orders priced on 1-second books; 7 stops timed on 1-second books; 40 stops timed on trades and priced on the book; 3 stops priced at the trigger price plus the book's depth; 2 used 1-minute fills (no usable book)

  • market orders priced on 1-second books: market orders that walked a recorded book.
  • stops timed on 1-second books: stops filled at the first book that crossed them, where no trades answered.
  • stops timed on trades and priced on the book: stops filled at the trade that reached them, priced on the book known then (see Tick fills).
  • priced at the trigger price plus the book's depth: stops with no book level at or past their price to walk. The price starts from the stop's trigger and adds the cost of walking the book's depth. The trigger is the stop price or the minute's close when the price moved through the stop between two books (see Order-book fills), the open when the stop gapped past every level, or the stop price when the book had no orders on that side.
  • limits filled at their price on a later 1-second book: limits placed during a minute that filled later in it.
  • used 1-minute fills (no usable book): orders in minutes without a recorded book, and market orders whose book had no orders on their side. Hovering over the line shows the first and last minute without a book (UTC).
  • other stops used 1-minute fills: stops past the per-run limit or stopped by the liquidation check.
  • ran out of book depth: orders that needed more depth than they could take (see above).
  • fills on books 2 s or more apart: fills priced on a minute with fewer than 30 books, such as the BTCUSDT period with books about every 10 seconds.
  • books at trade triggers a median 440 ms old: the median age of the book that priced a stop triggered by a trade. On our built-in strategies it was 0.4 to 1.9 seconds.
  • book data became unavailable at …, later stops used 1-minute fills: the market-data server could not send a minute's books.

Each part after the first appears only when it happened.

A backtest with tick fills on also shows a line like this on its results page:

Tick fills: 46 minutes resolved on trades; 3 minutes had no trade data (1m used)

  • resolved on trades: minutes where a stop or limit was filled on trades.
  • had no trade data (1m used): minutes that fell back to 1-minute fills. This part appears only when there were such minutes, and hovering over the line shows the first and last of them (UTC). If it is most of the run, check the symbol and window against the table above.
  • 1 liquidation fallback (or more): minutes where a possible liquidation sent the rest of the minute back to 1-minute fills.
  • before the trade data begins (1m used): minutes before the symbol's trades start (see Where trade data exists).
  • trade data became unavailable at …, later minutes used 1m: the market-data server could not send a minute's trades.
  • per-run limit reached, later minutes used 1m: the per-run limit ran out. A shorter window may keep the whole run on tick fills.

Tick fills: no stop or limit was reached inside a minute means the price never reached a resting stop or limit during a minute (a strategy that only uses market orders, for example), so tick fills changed nothing.

A forward walk says how many legs each fill model reached:

IS: 1-minute fills, selected params re-scored with the OOS fill model on 4 of 6 windows; OOS: 1-second book fills on 4 of 6 legs, trade-timed stops and limits on 4 of 6 legs

Trade-timed stops and limits is the default on legs with recorded books; tick fills means the Tick fills box was on. A leg that is not counted used 1-minute fills. Under the WFO efficiency, IS scored with the OOS fill model says the ratio compares like with like. Hovering over a batch number in the per-batch table shows that batch's fill lines and its in-sample re-run.

Forward walks run before these counts existed show Fills: IS 1m, OOS tick, or IS: 1-minute fills; OOS: 1-second book fills, for the whole walk. Their WFO efficiency compared 1-minute in-sample fills with out-of-sample book or tick fills, and the page says so under the ratio. On the 1m timeframe a walk shows no tick pass at a 1m timeframe.