Futures are unlike cash instruments such as equities in that they have a limited life span and therefore we lack proper long term data to analyze. We have two main problems to overcome; Which contract to base our time series analysis on and how to link contracts together.
When trading commences for a new contract it is usually quite a long time left to the expiry date and there is very little trading activity to be seen. Few people are interested in trading wheat with a delivery several years from now and as such the contract will remain relatively illiquid until it gets closer to expiry. At any given time, there will be one contract in each market, corn, orange juice, gold etc., which is the most liquid and the contract that almost everyone is trading at the moment. This can sometimes be the contract that is closest to the expiry date, but this is far from certain and there are no firm rules for when the liquidity switches to another contract or even which contract it switches to. For some markets this is very predictable and very straight forward, such as for equity index futures and currency futures, where the most liquid contract with a high degree of certainty is simply the one that has the least time left to expiry and the switch happens on the expiry date itself or just one or two days before it. In some commodity markets both the timing of the switchover and the selection of next active contract is completely unpredictable. For someone focused just on a single market, it is possible to stay close enough to that market to be aware right away when the attention of the traders switch from one contract to another, but as a systematic trader covering a large number of markets you need to find a way to automatically detect such changes. From the perspective of the typical trader, the most liquid contract is the only one that really matters.
The current price of two contracts with the same underlying but different delivery months will always be different and this is reflected in the term structure. The April gold contract will be traded at a different price than the December gold contract for the same year, and the same logic goes for any other market as well. Usually the price of the December contract will be higher than the April contract of the same year, in which case we have a contango situation, and this has nothing to do with the expectations of gold price changes. It may be intuitive to think that the higher price of the December contract reflects traders’ view that gold spot price should move up, but this is not at all the case. Instead the hedging cost, or carry cost if you will, is the core factor in play. The difference in base price between two contracts becomes acutely important when the currently traded contract comes to end of life and you need to roll to the next.
The reason for this price discrepancy is primarily related to hedging or carry costs. The problem that this creates for us is that when creating a continuous time series for long term simulations, one cannot simply put one contract’s price series after another. Doing so would introduce artificial gaps in the data where there really were no gaps in the actual market. What is required to do proper back testing simulations is a continuous time series that reflects the actual market behaviour, which does not necessarily mean that it reflects the actual prices at the time. The chart to the right is a completely unadjusted time series where contract after contract has just been put back to back. The closest contract has always been selected and held until expiry, when the next contract has taken over. This is the default way of looking at continuous futures time series in many market data applications and if you for instance chart the c1 codes in Reuters this is what you get. In this example it is easy to see right away when the contract rollovers occurred, even without the circles that I put in there. The seemingly erratic behaviour of the price during these periods does not at all reflect the actual market conditions at the time and basing your simulations on such data will produce nonsense results.
Now compare this with the more normal looking price curve in to the right. Notice how it is no longer possible to see where the contract rollovers occurred and the artificial gaps have been removed. If you look even closer, you will notice that while the final price is in the end the same, there are significant price differences between the two series on the left hand side of the x-axis. While the peak reading in October was about 17.3, the adjusted chart shows a peak of over 18. The difference can occur in either direction, depending on if there is a positive or negative basis gap at the time of the roll. The reason for this price discrepancy in the past prices is that I use back adjusted price charts here. For a back adjusted chart, the current price is always correct at the right hand side of the series, but all previous contracts will have a mismatch. When the roll occurs, the back adjusted series will adjust all series back in time and remove the artificial gap. This means that the whole time series back in time will have to be shifted up or down to match the new series.
There are several possible ways to achieve this adjustment and most good market data applications offer a choice in this regard, but it does not make a huge difference for the bigger picture which exact method you go with.
Lucky for you, properly adjusted futures charts suitable for trend analysis are available right here on this website. I have selected the most liquid contracts for each market, rolled with open interest and basis gap adjusted the series so you can analyze the charts right away!