Backtesting7 min read
How to Build a Futures Price Series for Backtesting
Build a reproducible futures continuous series for backtesting: define the roll rule, adjustment method, switch ledger, and contract-level simulated fills.
By TerraTrade Team

Why the series needs a rule#
A futures contract expires, but many strategies need a longer history than one contract provides. To test across contracts, researchers often create a continuous price series: a rule-based sequence of dated contracts joined at selected switch points. The result is useful for analysis, but it is a constructed representation—not one contract that could have been traded throughout the entire history. CME Group Continuous Price Series - CME Group Futures - QuantConnect.com
That distinction matters because neighboring expiries can trade at different prices. A raw splice can therefore show a jump at the switch that reflects the price difference between maturities, not a move earned by holding one contract. Adjustment methods can reduce or remove that discontinuity in the analytical series, but they do not change the prices at which the dated contracts traded. Improving Time-Series Momentum Strategies: Commodity futures data
This guide treats continuous futures contract backtesting as a data-construction task. The objective is to document how you chose the contract sequence, how you represented price history, and which dated-contract prices drive simulated fills. It is not a guide to when to roll a live position.
Choose and document the switch rule#
There is no single automatic definition of a continuous futures series. For example, CME describes an Active Contract series that switches according to historical liquidity and a Front Contract series that switches on a stated schedule before expiry. Its published series include a contract identifier and settlement price; some datasets also provide next-switch or similar fields. These are examples of defined methodologies, not a rule that every researcher must use. CME Group Continuous Price Series - CME Group Data Catalog - CME-Datamine
Choose an adjustment method#
Once the contract sequence is set, decide how to represent the price difference at each join. The choice changes the historical price path and can affect indicators or thresholds. It does not change the underlying contract’s recorded price. Improving Time-Series Momentum Strategies: Commodity futures data
Names such as “back-adjusted” are not sufficient documentation by themselves: vendors and research systems may differ in conventions. Record the actual formula, the observations used at each join, and whether the method revises past values when a later switch occurs. Additive and ratio adjustment are methodological alternatives, not a universally best choice. Commodity futures data
| Series treatment | What it does | What to watch |
|---|---|---|
| Unadjusted splice | Joins the selected contract prices without changing prior prices. | A maturity-price difference can appear as a discontinuity at the switch; do not interpret it automatically as a same-contract return. Improving Time-Series Momentum Strategies: |
| Additive adjustment | Applies a price offset to historical data around a join, according to the stated convention. | Record the reference prices, adjustment direction, and whether earlier history is recalculated as new joins occur. Commodity futures data |
| Ratio adjustment | Scales historical prices using a ratio derived from the selected roll observations. | Scaling changes historical price levels; document the formula and reference observations. Some implementations recalculate prior history after later rolls. Improving Time-Series Momentum Strategies: Commodity futures data |
Fill this out for each instrument and backtest run. The point is not paperwork for its own sake: it lets you distinguish a strategy result from a result caused by an undocumented splice, price adjustment, or contract mapping. CME’s continuous-series files illustrate why fields such as contract identifiers and, where provided, next-switch information are useful audit inputs. CME Group Continuous Price Series - CME Group Data Catalog - CME-Datamine
- Instrument and exchange: record the product, data source, and the exchange or vendor’s product identifier.
- Data inputs: list fields, frequency, timezone, session convention, and any missing-data handling.
- Roll rule: state the trigger, observation window, data timing, tie-breaks, and any expiry buffer. If using a vendor-defined series, name the rule and version.
- Switch ledger: for every change, record the date and time, outgoing and incoming contract identifiers, rule trigger, and the source observations used.
- Adjustment: state raw splice, additive, ratio, or another defined formula; include the exact old/new reference prices and adjustment direction at each join.
- Signal series: record whether indicators use adjusted or unadjusted data, and retain the series version used for the run.
- Execution ledger: for every entry, exit, and roll leg, store contract ID, timestamp, fill-price convention, simulated price, and applicable costs.
- Reproducibility: save data/code versions, parameters, run date, and whether later rolls can revise earlier adjusted values.
Use this validation pass after constructing the series and before interpreting a strategy result. Keep checks in the research record so a later data update can be compared with the original run.
- Rebuild the map. Starting from your stated rule and its historical inputs, check that every selected contract and switch date follows the rule. Compare your map with source records; do not assume a vendor label explains every convention. CME Group Continuous Price Series - CME Group Data Catalog - CME-Datamine
- Inspect each join. At the declared observation time, compare the outgoing and incoming contracts. Flag a jump that appears solely because the series changed contracts. Do not silently count the inter-contract price difference as a move earned by holding one contract. Improving Time-Series Momentum Strategies:
- Keep signals and fills distinct. If an adjusted series generates an indicator, log the mapped dated contract and its raw price used for the simulated fill. Place simulated orders against specific contracts, not an abstract continuous symbol. Futures - QuantConnect.com
- Compare signals. Recompute key indicators or conditions on adjusted and unadjusted series. Record the dates, signal states, and hypothetical positions that differ, especially near switches. A difference is a diagnostic to investigate, not proof that one version is correct.
- Reconcile returns. Calculate simulated P&L from the selected contracts and their simulated fills, including both closing and opening roll legs and the costs your model specifies. Do not infer executable P&L simply from changes in an adjusted historical price level.
What if the signal changes?#
A robust research workflow does not need to force adjusted and unadjusted data to agree. It needs to explain what each series represents and identify when the trading hypothesis depends on the choice. For example, a moving-average crossover may shift around a roll if the unadjusted series contains a maturity-price discontinuity; an adjusted history may produce a smoother analytical path but still cannot supply the contract’s executable fill price. Improving Time-Series Momentum Strategies: Futures - QuantConnect.com
Treat changed signals as a prompt to inspect the dates, formulas, mapped contracts, and execution assumptions. If a setup’s apparent behavior is concentrated around switches, report that sensitivity plainly rather than presenting one representation as a neutral fact. Then judge the test using the dated-contract fills and the costs and roll handling you have explicitly modeled.
The practical standard is reproducibility, not a universally perfect continuous series. Record the switch rule, switch ledger, adjustment formula, and dated-contract execution prices together. Then rerun the signal-sensitivity and P&L checks whenever the data, mapping, or adjustment convention changes.
A useful standard for the backtest
Strengths
- ✓A documented rule makes contract selection and switches auditable.
- ✓Separating signal data from fill data helps avoid treating an artificial join as a traded move.
- ✓Adjusted-versus-unadjusted comparison reveals sensitivity to the constructed history.
Limitations
- —A continuous price series is a constructed research representation; it is not a tradable contract.
- —Adjustment and mapping conventions can change indicators and historical values.
- —A price series alone cannot establish executable P&L without dated-contract fills and cost assumptions.
Frequently asked questions#
Can I trade the continuous contract itself?
No. It is a constructed historical representation that joins selected dated contracts. A simulated order should reference a specific contract rather than the continuous symbol. Futures - QuantConnect.com
Is back-adjusted data always better?
There is no single best method for every research task. State the formula and reference observations, then test whether your signals change under alternative representations. Additive and ratio adjustments alter historical price levels differently. Commodity futures data
How do I check for an artificial roll gap?
Store both contract identifiers and their prices at the switch, along with the rule trigger and observation time. Inspect the join and ensure the maturity-price difference is not being treated as a same-contract return. Improving Time-Series Momentum Strategies: Data Catalog - CME-Datamine
Which prices should determine simulated fills?
A continuous series can be used to calculate research signals, but simulated entries, exits, and roll legs should use the prices of the selected dated contracts and the fill convention in your model. Futures - QuantConnect.com
Sources#
- CME Group Continuous Price Series - CME Group — cmegroup.com
- Improving Time-Series Momentum Strategies: — cmegroup.com
- Data Catalog - CME-Datamine — datamine.new.cmegroup.com
- https://www.cmegroup.com/education/files/demystifiing-time-series-momentum-strategies.pdf — cmegroup.com
- https://www.cmegroup.com/insights/economic-research/2026/implications-of-wti-oil-futures-in-backwardation-amid-the-supply-crunch.html — cmegroup.com
- https://www.cmegroup.com/market-data/browse-data/energy-data.html — cmegroup.com
- https://www.cmegroup.com/markets/spot-quoted-futures — cmegroup.com
- https://www.cmegroup.com/trading/paceoftheroll/user-guide.html — cmegroup.com
- https://www.cmegroup.com/insights/economic-research/2026/how-backwardation-generates-positive-roll-returns-in-energy.html — cmegroup.com
- https://www.cmegroup.com/articles/2026/calibrating-treasury-link-dv01-weighted-spreads.html — cmegroup.com
- https://www.cmegroup.com/datamine.html — cmegroup.com
- Futures - QuantConnect.com — quantconnect.com
- Commodity futures data — imperial.ac.uk
- https://pdfs.semanticscholar.org/9c8e/e288c500735534f287dcc023337cccfedc58.pdf — pdfs.semanticscholar.org
- https://www.econstor.eu/bitstream/10419/239535/1/175145018X.pdf — econstor.eu
- https://citeseerx.ist.psu.edu/document?doi=2bd720e209d39e1cd065dffbfcca90229541aff3&repid=rep1&type=pdf — citeseerx.ist.psu.edu
KEEP READING

Strategies9 min read
Make Support and Resistance Rules Measurable
Build repeatable support and resistance strategy rules with objective pivots, explicit zone tolerance, setup definitions, and a reproducible test plan.
Read post
Strategies7 min read
How to Calculate a Stock Gap After a Split
Learn how to calculate a stock gap percentage after a split by aligning price basis, checking corporate-action dates, and recording inputs consistently.
Read post
Strategies7 min read
How to Calculate Session VWAP From OHLCV Data
Build session VWAP from historical OHLCV bars in a spreadsheet, with cumulative formulas, a worked example, and data-quality checks.
Read post