Backtesting Rolls and Continuous Contracts

Back-adjusted series lie in their own way.

Advanced 5 min read Course 34 of 60

Course 34 of 60 in the futures hub. This one covers testing futures strategies on historical data: how long-run charts get stitched together, which costs to subtract, and when to walk away from a result.

Stitched charts and what they hide

Every long-run futures chart is stitched together. Contracts expire, so a ten-year chart of crude oil or the E-mini is really a chain of separate contract months joined at each roll. The way they're joined changes the prices you see, and a backtest run on those prices inherits every choice the data vendor made.

Here's how it goes wrong: someone tests a rule on one kind of continuous series, then trades a real contract month that never behaved that way. Data quality is the first risk in any backtest, before a single rule. The forex course deals with testing on spot data, which has its own trouble with spreads and swap.

1. How continuous series are built

There are two common approaches. An unadjusted series switches from one month to the next at the roll and leaves a jump on the chart whenever the two months traded at different prices. A back-adjusted series shifts all the older history up or down by the gap at each roll, so the line looks smooth. The smooth one is easier on the eyes. It also shows prices that never traded.

Back-adjusted data is fine for asking whether a trend idea or a trailing stop has any life in it. It's poor at telling you what rolling cost, which month you'd have held, or what happened at the splice. Before testing anything that depends on exact price levels, find out which kind your platform gives you. Stops that come out of a test should go through the stop and target calculator on the real contract.

A back-adjusted continuous is a convenience — and a kind of lie What it is good for Seeing a long pathTesting a trail ideaNot for roll P&L What it hides The actual roll costThe month you would have heldGaps at the splice

2. Costs and slippage

Costs are where most futures backtests fall apart. Every round turn pays commission and exchange fees, every market order pays some slippage, and overnight fills are usually worse than daytime ones. Here's what a small edge looks like once costs come off:

Backtest edge 1.5 ticks per trade − 2 ticks round-turn costs = −0.5 tick per trade. On ES that is about −$6.25 a trade before a single mistake.

That test failed, however good the chart looked. Put the costs into the test itself: a realistic commission, exchange fees, at least a tick of slippage on market orders, and the cost of each roll. Check the limit-locked and gapped days as well, because a stop on those days filled far from where the test assumed. To see what a position ties up while you test, use the margin calculator.

A backtest without tick costs is a novel net = gross ticks − spread − slippage − roll − fees If net ≤ 0 there is no system ETH fills are worse than RTH fills Limit-lock days your stop did not exist Use the real month for any roll-sensitive test

3. The markets you didn't test

Survivorship bias usually comes up with stocks, but futures have their own version. Some contracts get delisted, some lose their liquidity, some get redesigned. Test only the markets that are popular today and you've already picked the winners. A rule that "works on everything" may only work on the handful that survived.

Test on the markets you'd really trade, over periods that include the dull years and the ugly ones. Note any spec changes inside your sample, since a different tick size or new trading hours halfway through will bend the results. The free calculators help turn tick results into dollars per contract.

4. Test on data you haven't seen

Curve fitting means tuning a rule until it matches the past perfectly. Add enough filters and any history looks like a gold mine. The defense is to split your data: build the rule on one stretch, then run it untouched on a stretch you never looked at. Walk-forward testing repeats that, moving the window ahead one step at a time.

When results collapse on the held-out data, trust the held-out data. Even a rule that survives will usually do worse live than in testing, so size for that.

Did you fit on the same years you are proud of? Held-out / walk-forward? Maybe honest still haircut live Curve fit do not automate

5. When not to automate

Some systems shouldn't run unattended. If the edge depends on a perfect roll calendar you won't watch, on fills during limit-lock days, or on overnight gaps the test ignored, keep a human in the loop. The same goes for a rule you can't state in one sentence, or results that only appear after a dozen filters.

Automation also makes mistakes faster. A bug that sends ten orders instead of one doesn't care what the backtest said. Run anything automated on the smallest contract first, with a hard daily loss limit set at the broker if it offers one. The lesson on psychology under leverage covers why people override good systems, which is the other half of this problem.

If the edge needs a perfect roll calendar you will not babysit, do not automate Do not automate when The test ignored locks and ETH gaps.You cannot explain the rule in one sentence.The Sharpe only exists after 12 filters.

6. Common backtesting mistakes

The usual ones: testing on back-adjusted data and trading a real month, leaving costs out, testing only today's popular markets, and tuning until the equity curve looks like a ruler. A backtest you can't explain in plain words is more likely luck than edge.

Data vendors change their methods and exchanges change contract specs. Recheck both before trusting an old test. The next lesson turns all of this into a written trading plan.

Rolling costs money

A backtest on a continuous chart quietly skips the roll. In real trading, holding across expiry means closing one month and opening the next, and that switch costs commissions, fees and the spread on both legs. A quarterly contract held all year rolls four times; crude oil, with a contract every month, can roll twelve.

Count those rolls in the test. Then check which month your rule would really have held on each date, since the busiest month isn't always the nearest one. If the test can't tell you which contract it held on a given day, it can't tell you what you'd have made.

What to remember when you test

  • Continuous futures charts are stitched, and back-adjusted prices never traded.
  • Subtract commissions, fees, slippage and rolls before reading the result.
  • Keep some data aside and don't touch it until the end.
  • Start any automated system on the smallest contract.

Treat a backtest like a witness you still have to cross-examine: it earns trust slowly and loses it in one bad month. Educational only. Not a recommendation to buy, sell, or hold any contract or pair.