Backtesting Futures Trading Systems

intermediatePublished: 2026-01-01

Backtesting Futures Trading Systems

Backtesting uses historical data to evaluate how a trading strategy would have performed. For futures, backtesting requires careful attention to contract rolls, margin requirements, and realistic transaction costs. Proper methodology separates robust strategy development from curve-fitting illusions.

Definition and Key Concepts

What Is Backtesting?

Backtesting applies trading rules to historical data to generate hypothetical performance results. For futures:

  • Entry and exit signals based on price patterns, indicators, or fundamental data
  • Position sizing according to margin and risk rules
  • P/L calculation accounting for contract specifications
  • Performance metrics (returns, drawdowns, Sharpe ratio)

Key Backtesting Components

ComponentDescriptionFutures-Specific Consideration
Price dataHistorical pricesContinuous contracts, roll adjustments
Transaction costsCommissions, slippageBid-ask spread, market impact
Position sizingContracts per tradeMargin requirements, leverage
Roll handlingContract transitionsRoll returns, timing
Capital allocationAccount managementMargin utilization, drawdowns

Continuous Contract Construction

Futures expire. To create a continuous price series for backtesting:

Methods:

  • Unadjusted: Splice contracts at roll, creates price gaps
  • Back-adjusted: Adjust historical prices to remove roll gaps
  • Ratio-adjusted: Adjust by price ratio instead of difference
  • Perpetual: Weight multiple contracts by time to expiration

Each method has trade-offs for different strategy types.

How It Works in Practice

Building a Continuous Price Series

Example: Crude Oil (CL) Roll

ContractLast Price Before RollFirst Price After Roll
CLH25 (March)$75.00— (expired)
CLJ25 (April)$75.50$75.50

Unadjusted series: Day before roll: $75.00 Day of roll: $75.50 Gap: +$0.50 (artificial gain if long)

Back-adjusted series: Subtract $0.50 from all historical prices: Day before roll: $74.50 (adjusted) Day of roll: $75.50 No artificial gap

When to use each:

MethodBest ForAvoid For
UnadjustedShort-term trades, level-based signalsTrend-following, P/L calculation
Back-adjustedTrend-following, momentumAbsolute price levels, support/resistance
Ratio-adjustedLog returns, volatilityAdditive calculations

Transaction Cost Modeling

Components of trading costs:

Cost TypeTypical RangeHow to Estimate
Commission$0.50-2.50/contractKnown from broker
Exchange fees$0.50-1.50/contractPublished by exchange
Slippage0.5-2 ticksMarket impact modeling
Bid-ask spread1-5 ticksAverage from tick data

Total cost per round-trip: Commission: $2.00 × 2 = $4.00 Slippage: 1 tick × 2 = $20.00 (for ES) Total: $24.00 per contract round-trip

For a system trading 500 round-trips per year on 10 contracts: Annual transaction costs: 500 × 10 × $24 = $120,000

Margin and Position Sizing

Risk-based position sizing:

ParameterValue
Account size$500,000
Risk per trade1% ($5,000)
Stop distance20 points (ES)
Dollar risk per contract20 × $50 = $1,000
Position size$5,000 ÷ $1,000 = 5 contracts

Margin check: 5 contracts × $12,000 margin = $60,000 (12% of account) Passes margin constraint.

Worked Example

Trend-Following System Backtest

System rules:

  • Entry: 50-day high breakout (long) or 50-day low breakdown (short)
  • Exit: 25-day opposite breakout
  • Position sizing: 1% account risk
  • Markets: ES, CL, GC, ZN

Backtest parameters:

ParameterValue
Period2015-2024 (10 years)
Starting capital$1,000,000
Transaction costs$30/contract round-trip
DataBack-adjusted continuous contracts
Roll methodRoll 5 days before expiration

Results summary:

MetricValue
Total return+187%
CAGR11.1%
Max drawdown-23%
Sharpe ratio0.82
Win rate38%
Average win/loss2.8:1
Total trades847
Transaction costs-$254,100

Year-by-year breakdown:

YearReturnMax DDTrades
2015+8%-12%92
2016+22%-8%78
2017-3%-14%95
2018+15%-11%88
2019+12%-9%84
2020+45%-18%102
2021+18%-13%79
2022+31%-16%96
2023-5%-23%87
2024+11%-10%46

Observations:

  • Returns clustered in trending years (2020, 2022)
  • Negative years (2017, 2023) during choppy markets
  • Transaction costs material (~14% of gross profits)

Roll Return Impact

Without roll adjustment: Gross system return: +205% With roll costs: +187% Roll drag: -18% over 10 years (~1.8%/year)

This reflects:

  • Contango in oil (negative roll)
  • Mixed term structure in gold
  • Quarterly rolls in equity and bond futures

Risks, Limitations, and Tradeoffs

Overfitting

The most dangerous backtest error:

  • Optimizing parameters to fit historical data
  • Many degrees of freedom = false discoveries
  • Out-of-sample performance disappoints

Mitigation:

  • Use simple rules with few parameters
  • Reserve out-of-sample period for validation
  • Cross-validate across multiple markets

Survivorship Bias

Historical data may exclude:

  • Delisted contracts
  • Failed exchanges
  • Changed specifications

Test on data that includes losers, not just surviving instruments.

Look-Ahead Bias

Using information not available at decision time:

  • Adjusted prices that use future roll prices
  • End-of-day prices for intraday decisions
  • Revised economic data instead of initial releases

Unrealistic Fills

Assuming fills at exact historical prices ignores:

  • Market impact of your order
  • Liquidity constraints during volatility
  • Slippage during fast markets

Common Pitfalls

  1. Ignoring transaction costs: A profitable system before costs may be unprofitable after realistic cost modeling.

  2. Using unadjusted data for P/L: Roll gaps create artificial profits or losses.

  3. Overtrading: Systems with many trades compound transaction costs.

  4. Parameter optimization: The "best" parameters in-sample are often worst out-of-sample.

  5. Ignoring margin utilization: Leverage amplifies both returns and drawdowns—stress-test margin calls.

Checklist for Futures Backtesting

  • Select appropriate continuous contract methodology
  • Include realistic transaction costs (commission + slippage)
  • Model roll returns explicitly
  • Apply proper position sizing based on margin and risk
  • Reserve out-of-sample period for validation
  • Test across multiple markets (not just one)
  • Avoid excessive parameter optimization
  • Verify no look-ahead bias in signals
  • Stress-test margin utilization during drawdowns
  • Document all assumptions and methodology

Next Steps

For tax implications of futures trading results, see Tax Treatment of Section 1256 Contracts.

To compare futures with alternative instruments, review Margin Efficiency vs. ETFs or Swaps.

Related Articles