Explainer
Common futures backtesting mistakes
Common futures backtesting mistakes: rules that use hindsight, ignored contract rolls, no costs, a hand-picked period, and trades the market never filled.
Updated
Hindsight in the rules
This is the quiet one. A rule uses information that did not exist yet at the moment it fires.
Take "enter when the day closes above the opening range". The close has to exist before the rule can fire, so the rule cannot be acted on at the time it claims to. A tool will run it and hand back a number anyway.
The test is to ask, for every input: could I have known this at that bar?
- Hindsight
- Using information in a rule that was not available at the time the rule would have acted.
- Contract roll
- The switch from an expiring futures contract to the next one.
- Back-adjusted
- A price series shifted so a roll leaves no jump. It is useful for display, not for simulating fills.
If a rule needs information that did not exist yet when it fires, the backtest is wrong before it starts.
Ignoring contract rolls
A futures contract expires, and trading moves to the next month. The new contract’s price is usually not the old one’s price. That difference is not a market move. Nobody could have traded it.
Continuous data chains the months together but leaves those jumps in the series. Run a backtest straight over it and a roll can trigger an entry, or take out a stop, on a price change that never happened.
We take the front month by volume, switching at the 18:00 ET session open. Prices are raw, not back-adjusted. No trade is held through a contract change: a position still open at the close of the last session before a roll is exited at that session’s final bar close, and nothing is reopened on the new contract.
Leaving out costs
Every trade pays commission, and every stop fill can slip. A backtest with neither shows a cleaner result than an account would.
Commissions and fees vary by broker; a backtest should use your own. Costs are applied after the run and do not move fills, stops or targets.
Choosing the period
Start and end dates picked after looking at the chart are a choice made with hindsight. A run that begins just after a bad stretch will look different from one that begins just before it.
Use the whole history the data allows. Ours runs from June 2, 2016 through August 27, 2026 for NQ and ES. Then keep months back so part of it stays unseen.
Counting a trade the market never filled
Some backtests record fills that could not have happened. A limit order filled at a price that printed once. A stop assumed to fill at exactly the stop price when price gapped through it. An entry on a bar that opened beyond the stop or the target.
We skip the last one and list it as skipped. A stop that gapped fills at the bar’s open.
The opposite mistake is just as common: dropping a trade that did fill because the order inside the bar looked unclear. See same-bar fill and stop.
Questions and answers
What is look-ahead bias in a backtest?
It is a rule that uses information from after the moment it is supposed to act, such as a daily close inside a rule that fires during the day.
Why do contract rolls matter in a futures backtest?
Because the new contract usually trades at a different price. Run over that jump and a roll can trigger an entry or hit a stop on a move nobody could have traded.
Do I need to include commissions in a backtest?
Yes. Leaving them out understates what every trade costs. Commissions and fees vary by broker; a backtest should use your own.
Should I use all the data I have?
Use the whole history so you are not choosing the period after the fact, and keep some months out of sight for a later check.