This post came about as a result of my own experience and frustration over the past couple of months while I have been developing a pairs trading strategy. After some initial research, I realised that I shouldn’t be looking for ‘correlated’ pairs of instruments to trade, but rather pairs that are ‘cointegrated’.
However the problem I then experienced was that the rationale and knowledge of mathematics that is required to measure cointegration was a very complex subject. Each article I read was filled with words and concepts I was not familiar with and so I was forced to do a significant amount of background reading before I finally felt I understood. Eventually after many late nights of reading, I was finally able to put my new-found knowledge to work in the algorithms of my trading system. I am sure I am not alone with this frustration...
After finally reaching a point where I now have a good understanding of the subject, I decided to write an article that I feel I would have benefited from, had it been available. It attempts to answer all of the questions I had back then, in one place. So here goes, but we warned, although I hope I have explained the necessary concepts from first principles, you will still need to be fairly maths savvy! I hope you find this useful.
By the way, if you are already a Maths PhD then you might find this article too basic for your purposes, so might want to look elsewhere.
Cointegration versus Correlation
I want to start by being clear about a statement made above. The fact that when designing a pairs trading strategy, it is more important that the pairs are selected/filtered based on ‘cointegration’ rather than just ‘correlation’. Here is an explanation:
Correlated instruments tend to move in a similar way. If one has an up day, the other will probably have an up day, and vice-versa. However, over time, the price ratio (or spread) between the two instruments might diverge considerably. See the chart of AUDUSD vs NZDUSD below. Clearly these are correlated but notice how the final ratio between the prices is almost 5% different at the end compared with the start.
Cointegrated instruments, don’t necessarily always move in the same direction, although they often will. The spread between the two instruments can on some days increase (and therefore the ratio of prices changes), but the fact that they are cointegrated means that the spread mean reverts and the prices usually find themselves being ‘pulled back together’ to the mean. See the chart of CAC40 vs EuroStoxx50. Although there are also signs of correlation here, pay particular attention to the fact that when the prices do diverge, it is not long before they are pulled back together. These are the visual characteristics of cointegration.
It is cointegration, as opposed to correlation that provides the optimal conditions for pairs arbitrage trading. Using the cointegration chart above, it can be seen visually that if the CAC40 (blue line) is above the EuroStoxx50 (orange line), a trading opportunity might be to short the CAC40 at the same time as going long on the EuroStoxx50 until a time that the spread between them reverts back to the mean.
It is cointegration, as opposed to correlation that provides the optimal conditions for pairs arbitrage trading.
In the next article...
So far we have relied purely on visual identification of cointegration. It is very important that you do not take this approach as part of your trading system. Visual identification is unreliable and cannot provide you with a measure of statistical significance. Rather you must base your pairs trading strategy on statistical methods of calculating the level of cointegration between a pair of instruments. We start to look at how you can do this is Part 2