Futures data field guide

Historical Futures Data for Backtesting: Contract Files, Realistic Fills, and Time-Ordered Tests

Pick dated or continuous futures history, decide whether ticks or bars can support your fills, and work through a 20-day breakout with no look-ahead bias.

Published · 1,553 words

Define the trade before choosing a history

A signal evaluated on a five-minute close usually fits bar data. A strategy that responds to each trade needs tick history and an execution model that cannot simply assume a fill at every printed price. Settle the market, session, holding period and order type first; the file format comes after. Then specify the market activity that would have had to occur for your order to fill.

Record the information time and the earliest execution time for each decision. They are separate clocks. At 14:04, the 14:05 bar still has no final close, so an immediate fill at that closing price uses information from the future. Shift the entry to the next observed bar and compare the result.

The phrase “futures price” also needs a definition. A question about one expiry can use that contract's prices. A five-year test crosses a succession of expiries, and the joins alter measured returns, signal thresholds, highs and lows. Document the construction alongside the rule so another researcher can run the same experiment.

What changes when contracts are joined

Dated, per-contract files keep each expiry separate. Use that history for delivery analysis, liquidity near expiration, or spreads tied to that contract. It is also the evidence to use when studying fills in the instrument you would have traded. Contracts expire. Activity commonly shifts to a later month before that happens.

A continuous series joins pieces of successive contracts, giving a moving average or momentum rule more history than a single expiry provides. Splice the raw prices untouched, though, and the jump between contracts can look like a return. Back adjustment moves earlier prices onto a common scale so point changes remain comparable. No one printed the adjusted level at the time.

In this collection, continuous ticks include price_raw and back_adjustment, with price = price_raw + back_adjustment. Verify that identity before using these columns. Account ledgers and order execution belong in raw-price space. An adjusted historical level has no direct comparison with an unadjusted stop or limit.

The guide to continuous futures contracts explains joins and adjustments in more detail. Keep the roll rule with the signal parameters: a different roll can shift the results just as much as a different lookback.

Match data resolution to execution

Tick history retains the sequence of individual trades, including prints that vanish when a bar is formed. OHLCV compresses each fixed interval into a summary, reducing storage and computation. You are choosing which evidence to keep, and neither format can rescue an unrealistic fill model.

Use bars when the model acts at interval boundaries and its orders are indifferent to what happened inside the interval. Trade-flow signals need ticks. So does a position whose stop and target lie within one bar: if the tape reaches both, selecting the winner after the fact is hindsight.

This collection builds its bars from back-adjusted continuous ticks in 10s, 1m, 2m, 5m, 30m, 1h, 4h and 1D. Intraday intervals are aligned to the epoch in UTC. Daily bars instead cover Chicago’s 17:00 session and follow it through daylight-saving changes; empty buckets have no row. Before treating a gap as damaged data, check the file and calendar, because an absent row can simply record inactivity.

Validate the timestamp before trusting the curve

Inspect the schema first: column names, dtypes, ordering and the keys that should be unique. For these per-contract ticks, ts records when the feed received the trade in UTC. Prices are float64, volume is uint32, and open interest is not present.

A valid bar contains ts, open, high, low, close, volume and trade_count. The high must be at least the open, close and low, while the low must be no greater than those values. Do not automatically discard a negative price. Find its cause: back adjustment can produce one, and percentage-return or volatility calculations may fail on that input.

assert (bars["high"] >= bars[["open", "close", "low"]].max(axis=1)).all()
assert (bars["low"] <= bars[["open", "close", "high"]].min(axis=1)).all()
assert bars["ts"].is_monotonic_increasing
assert (bars["volume"] >= 0).all()

Run calendar checks independently of price arithmetic. Retain UTC source timestamps, and rely on a real timezone database when defining sessions or rendering local times, including both daylight-saving transitions. Each daily label must map to one unambiguous session. A weekday is not proof of a full trading day; it could be a holiday, an early close or a day with no session.

Clean columns can still hide bad history

Zero nulls say almost nothing about whether the data can support a trade simulation. Problems survive in tidy columns, so go further:

  • Recalculate volume for a sample of bars from their source ticks and reconcile the totals.
  • Treat fully duplicated rows differently from genuine trades that repeat a timestamp or price.
  • Interpret gaps against holidays and session hours before deciding whether to fill them.

Carrying a price through a closure manufactures activity that never happened.

Give contract joins the same scrutiny as anomalous ticks. Examine raw and adjusted values on both sides of every join, and review the largest moves in each price space. Some of those moves belong in the sample. Deleting an extreme because it damages the strategy changes the question being tested; every correction needs a documented reason and the same treatment throughout the sample.

Field names can mislead as well. Here, bid_sz and ask_sz are volume executed at bid and ask, not queue sizes. Neither tells you how many contracts were queued ahead of yours. A full liquidity model therefore needs additional evidence.

The field reference defines each field and derived value. Keep the validation output beside every run. That record is how you verify whether two backtests shared their inputs and assumptions when you compare them later.

Fit early, evaluate late

Training, validation and final evaluation must follow the calendar. Estimate parameters on the early sample and use validation to compare a small candidate set. Freeze the rule after that. The samples need rolls and different volatility regimes. Randomly shuffled rows throw away the sequence the strategy would have to obey.

Volatility thresholds, roll settings, the selected bar interval and even scaling constants are fitted choices. Learn them on training data alone. A change prompted by final-test performance turns that test into development data; further claims require another period the work has not touched.

Net profit can hide a poor experiment. Include the number of trades, turnover, drawdown, exposure and annual results in the report. Then increase costs or postpone entries to locate the point where performance deteriorates. One exceptional week can carry an otherwise weak curve. Fixed-holding and no-position baselines make that dependence easier to see.

A walk-forward test fits an expanding or rolling window, applies the result to the next unseen window, and stitches together only those out-of-sample observations. Choose the windows and refit dates in advance. Trying repeated walk-forward configurations is still model selection; none of those trials can stand in for a final untouched evaluation.

Timing a 20-day breakout

This rule buys after a 20-day high and exits ten sessions later. Its entry has to wait until the signal actually exists.

  1. Build each channel from back-adjusted daily bars, using only sessions completed before the current session.
  2. Once session t has closed, calculate the signal. Entry occurs in session t+1; the high that created the setup is no longer available as a fill.
  3. Apply entry and exit costs and slippage under one consistent set of assumptions.

Why the channel is shifted

The channel contains only completed prior sessions:

session     close   prior_20d_high   enter_next
2025-03-03  6012.5       6008.0          True
2025-03-04  6021.0       6012.5         False
2025-03-05  6017.5       6021.0         False

On March 3, only information available through that close is allowed. The channel omits March 3 itself, and the fill on March 4 cannot be revised after the fact. Examine several actual contract joins as well, with at least one inside a holding period. The adjustment must not manufacture a breakout or alter position sizing beyond what the live rule could reproduce.

Lock the pipeline and reserve the later observations before running the final evaluation. When additional history is required, settle the interval and coverage before opening the data catalog. Do not let an easy download rewrite the hypothesis.

Report what the backtest cannot prove

Even a sound historical test cannot establish that next month will be profitable. A continuous research price may not correspond to any price in a tradable contract. Bars omit the path between open and close. Ticks recover more of the sequence but still omit queue position, rejected orders, latency and much of the context around a live fill.

Clean data can still produce a misleading backtest. Enough parameter trials will eventually flatter the chosen sample, and the selected market and years may exclude the conditions that defeat the rule. Margin, costs, position limits and whether the contracts could actually support the positions require their own analysis. A rule that mixes raw and adjusted price levels can be distorted without any obvious error.

Put those caveats on the same page as the performance figures. Rerun the frozen pipeline with a later entry and higher costs, then run it on data held out from development. Keep a record of every change. The point is to locate the idea's failure conditions before real capital finds them.