Futures Backtesting Checklist: Verify Data, Contract Rolls, and Trade Fills
Audit futures data, make roll decisions causally, stress execution assumptions, and reserve one final test. Leave a record another researcher can reproduce before sign-off.
“Momentum works” leaves the test unspecified
Specify the market mechanism, the direction in which it should move prices, and the evidence that would weaken the case. Define the instrument universe and contract eligibility. Signal inputs, decision frequency, holding period, position limits, and roll treatment also need explicit values. Give each decision a subsequent execution event, and settle on the primary metric plus drawdown or tail-risk limits before opening the performance results.
One testable formulation is a 20-session high in MES triggering an entry at the next eligible session price, an exit ten sessions later, and whole-contract sizing. Set rejection conditions in advance: the idea fails if delaying entry by one bar or charging two more ticks per side erases its edge. These numbers are illustrative research controls, not evidence that this rule is profitable.
Use exploration to find candidates and untouched data to test them. Record each event exclusion and when the choice was made. If capacity is part of the claim, observed activity must set a participation limit.
Give every input file an auditable identity
For every input file, record product, dated contract or continuous series, date range, schema version, interval, checksum, and row count, along with coverage gaps and differences among instruments. Derived files need their lineage. Keep raw and adjusted prices from blending unnoticed, and do not confuse a daily session bar with a bar bounded by UTC midnight.
For the per-contract ticks here, ts is the UTC feed-receive timestamp, price has dtype float64, and volume has dtype uint32. Executed volume at the bid and ask goes into bid_sz and ask_sz; these are not resting-book sizes. With open interest absent, the inputs cannot support queue models or open-interest filters.
The continuous schema introduces price_raw and back_adjustment, where price = price_raw + back_adjustment. Bars derived from back-adjusted continuous ticks contain ts/open/high/low/close/volume/trade_count, at intervals of 10s, 1m, 2m, 5m, 30m, 1h, 4h, and 1D. Epoch-aligned UTC intervals govern intraday bars. Daily bars instead follow Chicago 17:00 sessions across DST, and empty buckets remain omitted. Use the schema documentation as the reference for these fields.
A notebook entry that says “2025 MES data” is not an input manifest. Give each file its own row. Filenames cannot distinguish one rebuilt continuous release from another, so pair the checksum with the row count and observed UTC endpoints; a later run then has no silent path to a different data generation.
Sorted UTC timestamps do not guarantee valid sessions
Make dtypes and timezone handling explicit at load time. Fail the run on unexpected columns, nulls in required fields, non-finite prices, invalid timestamps, or numeric overflow. Malformed values must raise errors rather than quietly become missing data. Enforce monotonic timestamps within each intended contract and partition. Equal timestamps require their own ordering rule, since their sequence cannot establish causality between trades.
For sampled continuous rows, subtracting raw price from adjusted price must reproduce the stored adjustment. Check that each bar's high is at least its open, close, and low; its low is no greater than its open, close, and high; volume is nonnegative; and trade counts are consistent. Independently resample several tick intervals and reconcile OHLC, volume, and count. Session-local exchange boundaries must control daily bars, while intraday bars keep their epoch alignment through DST.
Exercise calendar utilities in unit tests at 17:00 Chicago, on both DST transitions, over weekends, and around early closes. Retain examples of rejected rows beside the validation report. A count of green checks, with no underlying artifacts, gives a reviewer little to inspect.
Not every repeated record is a duplicate
The duplicate key comes before deletion. Exact repeated rows, repeated timestamp-price-volume combinations, and legitimate simultaneous trades are separate populations. Count each one before removing anything and preserve the audit trail. Deduplicating on timestamp alone can erase real activity. The product calendar should likewise distinguish inactivity and scheduled closures from unexplained gaps, because omitted empty buckets also produce missing bars.
Allow for binary floating-point representation when checking prices against the instrument's tick grid. Flag abrupt scale changes, impossible jumps, and anomalous volume for review. Negative or zero prices warrant a check where the product disallows them. Do not discard a valid extreme print merely because it damages the strategy. Cross-check suspicious rows in related intervals and dated contracts, and document how each case was resolved.
validation_report = {
"rows": rows_checked,
"duplicate_rows": exact_duplicates,
"nonmonotonic_contracts": ordering_failures,
"off_grid_prices": grid_failures,
"unexplained_session_gaps": gap_failures,
}
Here, bid/ask size fields describe executed trade side and nothing beyond that. They cannot recover displayed depth, queue position, or the liquidity that a later market order would encounter.
Continuous history does not execute the contract roll
Use the continuous file for signal history and dated contracts for the actual switch. Document the roll policy, when its inputs became available, and the source and destination contracts. Rebuild the account position across every roll and charge both sides. A volume trigger is causal only when it uses information available at decision time.
Back adjustment adds back_adjustment to price_raw to preserve a selected historical relationship. The adjusted levels are constructed and may never have been quoted; in some settings they can be negative. A signal can consume that series consistently, but dated-contract economics must drive orders, multipliers, and cash P&L. No cash flows from the offset itself.
Evaluate several plausible roll windows and keep the results separated by episode. Inspect returns that bunch around the joins. Selecting the window with the highest P&L would simply fit the roll as another strategy parameter. These timing errors are examined in the guide to causal futures research and look-ahead bias.
A credible fill model includes bad days
Model the order type, submission delay, eligible session, fill price, partial-fill behavior, and cancellation logic. When a signal depends on a completed bar, taking that same bar's close as the fill requires a defensible timing mechanism. Closure rules reject orders while the market is shut. At the next opening, order instructions govern execution; during a roll, each contract brings its own liquidity.
Include commissions, applicable exchange and clearing charges, spread, slippage, and impact. Volatility, activity, time of day, or size may justify cost variation when evidence supports it. Resting depth is unavailable here, so precise queue simulation is impossible and conservative scenarios are necessary. A zero-volume interval provides no demonstrated execution opportunity; a carried-forward price does not create one.
Report performance before and after costs alongside cost per trade, turnover, participation, and sensitivity to delayed entries. Put immediate, next-eligible, and adverse fills side by side. The futures backtest cost and slippage guide shows the arithmetic. These comparisons cannot remove uncertainty about live outcomes, but they should expose execution assumptions that are too optimistic.
Use the final test once
Split the timeline into training, validation, and final test periods before any fitting. Scalers, thresholds, universe rules, and feature selection belong to training. Model and parameter choices belong to validation. Then run the prespecified final evaluation a single time. If its outcome inspires a change, that period has joined development and a different untouched interval is required.
Purge overlapping labels or positions at the boundaries and apply an appropriate embargo. Each walk-forward step repeats fitting and selection. Learned roll calibration belongs inside that loop, with different contract regimes, volatility environments, and holiday periods represented. A random split chosen for convenience will not create this structure.
Map the surrounding parameter space. Results at nearby lookbacks, thresholds, and holding periods should behave coherently; an isolated spike is a warning. Compare against simple benchmarks and no trade, with dispersion shown by instrument and time block. A single strong year is thin evidence.
Keep the failures and make the report reproducible
Stress the strategy with delays of one bar and several bars, wider spreads, cost multipliers, lower participation, alternative rolls, missing sessions, and opening gaps. Historical stress windows and synthetic shocks should challenge the mechanism on which the strategy depends. Double volatility, drive correlations together, or delay the signal. Show the point at which trading halts or risk limits fail.
Assign one run ID to the code revision, environment, configuration, seed, data manifest and checksums, calendar version, roll schedule, validation output, and metrics. A deterministic rerun has to reproduce the result exactly. Retain rejected configurations next to the chosen one so reviewers can see how much searching occurred.
Store the command or notebook entry point that recreates the report. When a check breaks, retain the first failing row. Reviewers should be able to trace an equity curve to its script and inspect the observation that broke a check without scanning a year's worth of ticks.
The evidence required for sign-off
- The hypothesis, primary metric, failure criteria, and data splits were fixed before final evaluation.
- Schema, dtypes, UTC ordering, duplicates, gaps, tick grid, and bar identities all have documented checks.
- Evidence supports the roll mapping, raw and adjusted prices, session calendars, and DST handling.
- Fill timing and market hours are enforced, with costs and liquidity limits stressed.
- Selection stayed in validation, and the untouched test was not retroactively tuned.
- The report covers parameter neighborhoods, subperiods, adverse scenarios, and benchmarks.
- The same output can be recreated from the retained artifacts, checksums, configuration, and code.
- The edited record still contains negative findings and limitations.
Put the poor subperiod, orders that never filled, and failed parameter neighborhoods in the sign-off package. Sign off only when the evidence, including those failures, supports the research conclusion. That decision covers this experiment; it makes no promise about next month.