From the June 01, 2011 issue of Futures Magazine • Subscribe!

How to backtest trading systems and avoid curve fitting

Trading reality

What would be the use of the prices in back-adjusted contracts if they are generally bogus? Suppose we enter a position in lean hogs on the first day in the series and hold it until the end. We roll the position forward from one delivery month to the next. If we ignore commission and slippage, the exact value of the position can be calculated at any time from the back-adjusted chart because of back-adjusted contracts representing a special type of reality, namely trading reality. They depict what will happen to the trader holding a continuous position in any market. Hence, these contracts are the perfect resource for computerized system tests.

The next consideration is when we roll the contracts, defined by the roll trigger. Roll trigger determines when a continuous contract switches from one futures month to the next. Details may vary with the data management software, but in CSI Unfair Advantage, depending on conditions, roll trigger can be based on open interest, volume, a specific date or some combination of these (see "When to roll").


Rolling data affects market range and liquidity, so the timing of when we roll greatly affects the trade. Indeed, using different rollover logic can affect system performance greatly, both in testing and real time. For example, a difference of 20%-30% is possible between rolling on open interest and rolling based on a fixed date.

In addition, rolling on volume and open interest in some markets can be risky, as the first day of notice can occur (and often does) before the roll. For some trading systems, such as trend-following systems, this can exaggerate the profits.

Another issue to watch for is roll congestion. Money benchmarked to the S&P Goldman Sachs Commodity Index and other long-only commodity indexes has grown exponentially in the last half dozen years, with some estimates of size of the indexes approaching $300 billion. This has changed the nature of front-month and second-option spreads. Many traders and programs try to take advantage of the size of these rolls; that tends to push spreads toward full carry much earlier than would be otherwise. The bottom line is that the huge positions being rolled must be considered along with more traditional factors when rolling.

Ratio-adjusted contracts

Ratio-adjusted contracts are another concept. The right approach for the ratio-adjusted contract is to consider each contract roll similar to the classic split in equities, which is you get x shares for every y shares you hold, and the market price adjusts to reflect the market capitalization of the company in question.

Supposing a company does a 10-for-one split, it means that for every share you hold, you get 10 new shares. The price shall be divided by 10 after the split occurs. This creates a big price gap during the split. To avoid showing this gap, historical data also are divided by 10, so prices are depicted in the same manner as they are today. In effect, pre-split data have been back-adjusted using a proportional ratio.

We can apply the same process of proportional back-adjustment at every contract roll on futures contracts. Here, you need to calculate the adjustment ratio (price of new contract/price of old contract) that ensures a relative constant relationship in terms of percentages between any prices across the trading history. For example, assume on rollover the old contract closes at 1000 and the new contract is priced at 990. We need to multiply all old prices by 990/1000 to remove the gap between the two contracts.

Some issues remain, especially those relating to actual tick size vs. calculated tick size as compared to the maximum tick size (a contract-specific parameter you need to consider in your strategy and testing). In addition, consider that the data range prices don’t follow the tick size as they are being adjusted; the entire price series has been altered, so calculation of dollar profit/loss from these contracts is not possible; nor is using dollar-based targets. However, percentage-based calculations for both trade results and stops can be done.

Other methods include forward-adjusted contracts, which apply the difference going forward; compressing the adjustment over a few days to maintain price levels over most of the contract history; and manually adjusting each price according to the difference on that specific data, not just the rollover date.

History does not exactly repeat itself. However, history is all we have. Patterns and characteristics do persist, and just as a child isn’t a perfect replica of its parents, future market movements don’t exactly follow the lead of the past. However, traits are predictable reliably if we base those predictions on a logical premise, not random relationships. Developing these premises and testing them in the proper environment of backtesting assumptions is the key to trading system development. In the next issue, we’ll take a closer look at the specifics of these assumptions, and how you can make sure you formulate the right ones.

Murray A. Ruggiero Jr. is the author of "Cybernetic Trading Strategies" (Wiley). E-mail him at

<< Page 3 of 3
About the Author
Murray A. Ruggiero Jr.

Murray A. Ruggiero Jr. is the author of "Cybernetic Trading Strategies" (Wiley). E-mail him at

comments powered by Disqus