Backtest

A backtest applies a fully specified trading rule to historical data under an explicit execution model and reports what would have happened after costs. Its result is conditional on the data coverage, the fill assumptions and the number of rules tried; it describes the past under those assumptions and does not prove a future edge.

Senzoukria · Glossary · Updated September 2026


What a backtest needs before it runs

  • A rule written in full: instrument, session and time zone, bar construction, signal timing, entry, exit, size and data exclusions.
  • Data that actually contains the rule's inputs. A footprint rule needs executed bid and ask volume per level; a depth rule needs book history; neither can be recovered from OHLC candles.
  • An execution model that states when decisions are made, at which price entries fill and what happens when stop and target could both be hit inside one bar.
  • Costs: fees per contract and per order, slippage on entry and exit, converted with the instrument's tick value.

Three kinds of historical test

A limit price touched by a recorded execution is not proof that your order would have filled; queue position is not in the data. A gap in coverage is not a flat market. These limits belong in the result, not in a footnote.

Each model answers a different question
ModelCan evaluateDoes not establish
OHLC bar testClosed-bar rulesIntrabar sequence, queue fills
Trade replayRules on recorded executionsMissing historical depth
Book replayDepth events within coverageYour own counterfactual fill with certainty

What the result means

A green equity curve answers one narrow question: what happened under the assumptions that produced it. It says nothing about whether the rule was defined before the test, whether the fills were achievable, or how many variants were discarded on the way. The stronger the result after many attempts, the more evidence it needs. Report out-of-sample results, failed configurations and sensitivity to higher costs alongside the curve.

In Senzoukria

The Replay screen has an Automatic backtest mode. Its panel runs a strategy from the script editor bar by bar on the bars cached on the machine. Before a run, the panel reports the coverage of those cached bars in sessions and says what is missing, so the result is labelled with the window it actually covers.

A Transaction costs block takes fees and slippage in ticks; its hint notes that setting both to zero is the first way a backtest lies. Decisions are made on closed bars, entries fill at the next open and exits use bar prices; the engine does not reconstruct an exchange queue. A Backtest assistant can comment on the statistics of a finished run. Nothing in this screen sends an order; live execution exists only through an autopilot a person arms explicitly.

Common mistakes

  • Calling a syntax check on synthetic bars a backtest.
  • Running with zero costs and comparing against a result that included them.
  • Carrying a level from one futures expiry into the next without addressing the price difference at the roll.
  • Keeping only the winning variant and forgetting how many were tried.

This page in other languages

Frequently asked questions

Can order flow strategies be backtested?
Yes, when the historical data contains the inputs the rule reads. A footprint rule needs executed bid and ask volume per price level, which tick history provides and candles do not. A rule that reads resting liquidity needs recorded depth, which is rarer and larger. Without those inputs the rule cannot be evaluated, only approximated.
Does a profitable backtest prove an edge?
No. The result is conditional on execution assumptions, costs, data gaps, the number of configurations tried and the market conditions of the period. A backtest that survives higher costs, holds up on data it never saw and was defined before the test is stronger evidence, but it remains evidence about the past.
What should be recorded with a backtest?
The rule version and parameters, the number of configurations tried, the data source, contract, dates, session and missing intervals, the entry timing and ambiguous-bar policy, fees and slippage, the training and test splits, net results and drawdown by window, and a rejection criterion decided in advance. That record is what makes the result reproducible and comparable.

Keep reading