Futures Backtesting: Costs, Replay and Walk-Forward
A futures backtest applies a rule to historical data with an explicit execution model. For an orderflow strategy, distinguish bar-based tests, trade replay and order-book reconstruction. Each answers different questions about what could have been observed and executed.
Senzoukria · Learn · Updated 13 September 2026
Define the rule before selecting parameters
Record instrument, contract, session timezone, bar construction and signal timing. A footprint trading rule needs executed bid/ask observations; a heatmap rule needs historical depth. Neither can be recreated from ordinary candles.
Store the roll policy and coverage report. A gap is not a flat market. A level on one futures expiry cannot be carried into another without addressing the price difference.
Bar tests, tick replay and book replay
| Model | Can evaluate | Does not establish |
|---|---|---|
| OHLC bars | Closed-bar rules | Intrabar sequence, queue fills |
| Trade replay | Recorded executions | Missing historical depth |
| Book replay | Depth events within coverage | Your counterfactual fill with certainty |
If stop and target both fall inside a bar, OHLC does not identify which came first. State the engine's policy. A limit price touched by an execution is not proof that your own order would have filled.
Costs can reverse a result
Illustrative example: 2.5 ticks gross expectancy minus 0.5 tick slippage on entry, 0.5 on exit and 0.8 tick equivalent round-trip fees leaves 0.7 tick net. Another tick of total slippage produces −0.3 tick. These are hypothetical inputs, not measured platform performance.
Convert fees with the actual instrument tick value. Separate per-contract from per-order fees and avoid omitting or double counting the spread.
Walk-forward testing without leakage
- Fix training length, test length and parameter selection in advance.
- Fit on training only and freeze the chosen parameters.
- Evaluate the later window including costs and failed trades.
- Advance chronologically, retaining every out-of-sample result.
- Keep a final untouched period for decisions not already tuned to those results.
Selecting the winner of many configurations introduces selection bias. The Probability of Backtest Overfitting examines this problem. Robustness analysis challenges results; it does not certify future profits.
The experiment record
- Rule version, parameters and number of configurations tried.
- Source, contract, dates, session and missing intervals.
- Entry timing, ambiguous-bar policy, fees and slippage.
- Training/test splits, net results and drawdown by window.
- A rejection criterion and sensitivity to higher costs.
A Hurst estimate or GEX regime can motivate a hypothesis. It cannot replace a record of what was known when the decision occurred.
Research in Senzoukria
Use scripting for indicators and rules, then historical backtesting for supported JavaScript and Python strategies. The historical execution model is bar-based, not a reconstruction of queue priority. C++ has a separate runtime and no historical backtest path.
Replay and broker execution are distinct steps. The optional live autopilot requires explicit arming and a compatible Rithmic account. A backtest neither arms it nor proves prop-firm permission. Preserve the research record in the trading journal.
Frequently asked questions
- Can orderflow trading be backtested?
- Yes, when historical data contains the required inputs. Footprint rules need executed bid/ask volume; depth rules need book history. OHLC bars cannot recover missing ticks or depth.
- What is walk-forward testing?
- Choose parameters on a training window, freeze them for a later test window, then move forward chronologically. Keep the selection rule fixed and prevent future information from entering training.
- Does a profitable backtest prove an edge?
- No. Execution assumptions, costs, data gaps, selection bias and changing market conditions can invalidate the result. Report out-of-sample results and failed configurations.
- Which languages support historical backtests?
- Senzoukria supports historical JavaScript and Python strategy backtests in the desktop. C++ scripting uses a separate WebAssembly runtime and does not provide historical backtesting.