Systematic Trading research and development, with a flavour of Trend Following
Au.Tra.Sy blog – Automated trading System header image 2

Trade what you Test and Test what you Trade

January 20th, 2011 · 5 Comments · Backtest, Data

test-trade

In order to avoid bad surprises in live trading, the maxim forming this post title should apply to as much of a trading system as possible. The goal is to ensure back-testing results are as realistic as they can.

Input data is one component of a trading system and the area this post focuses on, more specifically roll-over methodologies for futures contracts.

Real Monthly Trading Also Means Monthly Roll-Over

One of the triggers for this post was a comment on the Monthly Trading post with regards to the futures data used for the test. In order to have comparable results between the daily and monthly instances of the systems tested, I simply and mechanically reused the same portfolio of instruments…

However, futures contracts in the portfolio roll on Open Interest. What this practically means, is that a trader using this methodology would have to monitor OI every day to decide whether to roll to another contract. Not much of a monthly process.

I still think that test had some value, but it is important to realise that the monthly instance in that test was not representative of a pure monthly process. Instead we were actually simulating a trading strategy with monthly signal taking but daily roll-over monitoring process.

It highlights the fact that it is important to understand what the data used for testing actually represents, and to roll futures contract data in the same way as they are rolled in real-life.

This post is a good opportunity to revisit the concepts of generating continuous futures data and some of the older posts I had written on the subject using CSI (here and here).

ETF: Outsource your Contract Rolling Process

Another reason why I think that the monthly trading test has some value is because the individual monthly trader might decide to trade ETFs instead of futures.

ETFs can be seen as simple wrappers of futures contracts: they trade continuously and their managers take care of rolling their underlying positions with a predefined methodology and timing, charging you a fee in the process.

Of course, this is not futures Trend Following any more, and using ETFs lacks the inherent leverage embedded in futures instruments. But it is possible to obtain decent performance with Trend Following on ETFs (check this ETF Trading book by Anthony Garner for example). An assumption in that book (which I will attempt to verify in a next post) is that futures can act as proxies for ETFs/ETCs.

Contract Rolling and Testing

Rolling contracts is a process necessary to generate a continuous time-series for back-testing futures instruments. There are many different ways to perform this operation (some of which are covered just below). What is important is that the continuous contract should be a realistic representation of one’s trading.

Proportional vs Point-Based Adjustments

At the time of writing these posts on continuous contracts, I was leaning towards the idea that proportional adjustment was the way to go:

This ensures a constant relative (percentage-wise) relationship between any prices across the trading history“, as opposed to the point-based adjustment, with which “you lose relative price difference (shifting all prices by an absolute amount has that effect on percentage changes: 10 to 11 is +10% but add 100 to both for an extreme case and 110 to 111 becomes less than +1%)“.

When back-testing with Trading Blox, the standard functionality expects the prices to be point-based adjusted, to calculate trade PnL:
(ExitPrice – EntryPrice) * BigPointValue * NumberContracts
With a point-based adjustment, the number of points between entry and exit will represent the actual points the market has moved during the life of the trade, as opposed to proportional adjustment (which would give wrong PnL calculations).

But point-based adjustments prevents us from using relative price difference, such as “check if close today is 5% higher than close yesterday” as an example. This might be an issue for some systems, but there are workarounds for this in Trading Blox though.

We do not have to limit ourselves to one or the other methodology, but we have to understand what the rolling algorithm represents and which data best suit each test.

Of course, you can even go with a more fancy approach to rolling (if this represents what your trading is), like one we had covered here last year with a rolling methodology attempting to optimize roll yield.

Back-Adjusted or Forward-Adjusted?

Another switch on the rolling methodology dashboard (in CSI) is the possibility to perform back-adjustments or forward adjustments. This only determines which price is fixed and in which direction the “adjustment drift” will propagate through the time-series. Forward-adjustment picks the earliest price as the reference price and moves each following contract by the required adjustment amount/ratio to fill the “rolling gap”. Backward-adjustment is the opposite: reference price is last price and adjustment propagates backward.

In order to get recent prices in line with real price levels, most traders prefer back-adjustment. From a back-testing point of view, it should not have much impact. However, the chart time-series will look quite different.

To illustrate this, here is an example chart plotting the same underlying (Crude Oil) since 2007, with four different standard CSI rolling methodologies:

  • Proportional, Forward Adjustment
  • Proportional, Backward Adjustment
  • Point-based, Forward Adjustment
  • Point-based, Backward Adjustment
Mix of Point and Proportional, Back and Forward Adjustments

Mix of Point and Proportional, Back and Forward Adjustments

Going back to the monthly trading test, I did take my data “for granted” as it works for most cases… but not really for this one. It does emphasise the point that “Trade what you Test and Test what you Trade” should also apply to data and rolling methodologies, which need to be checked/reviewed for each new system.
 
 

Credits: thanks to Pumpernickel for the comment pointing out the discrepancy in the previous post between daily roll-over and monthly signal taking (and for this post title contribution, as part of a comment on an earlier post).
Picture Credits: Trading Blox screenshot and artemuestra@flickr(CC).
Related Posts with Thumbnails

Tags: ·

5 Comments so far ↓

  • Pretorian

    I would say that ETFs offer the same leverage than futures, provided you are not an US based investor. The trick is to use CFD (contracts for difference) of ETFs which are a very popular instrument in Australia but are also used in Europe, I think in Great Britain is known as “spread trading”. I have been using those in Saxobank (a broker that I highly recommend). They normally charge a very low interest (libor + 3 more or less). Normally you only have to leave 5% as collateral which is what you would get in futures contracts. However, there is one disadvantage: if you are short the ETF and the futures contract is in Contango, you would be paying interest instead of “receiving” the roll yield, in any case they can be very helpful for a strategy like the one you mention. In addition I have found that some ETFs options are more liquid than the underlying options on futures contracts (silver for example).

  • hopewell

    my question: if proportional adj. will give wrong PL calculation, why would someone want to use it in the tests?

  • Jez Liberty

    You might need to use price ratios in your system indicator/logic (which are not maintained with point-based adjustment).
    The way the P&L is calculated is dependent on the back-testing platform. For TB, there is this limitation, meaning that you need to implement a custom mixed solution using both prop-adjustment and point-adjustment.
    Ideally, a back-testing platform would be flexible to handle both adjustments as standard…

  • jp

    I’m curious about strategies to actually roll the contracts. Are most people simply placing simultaneous buy and sell orders at the market, or something more so sophisticated?

  • Jez Liberty

    jp – some markets trade spreads, which is one way to sell one contract/buy another one simultaneously. There are quite a few threads on rolling “tactics” on the TB forum so I’d recommend you have a look there as well.

Leave a Comment