Cointegration vs correlation: why correlated assets can still drift apart
Ask anyone how to find a pair to trade and the first answer is usually "find two highly correlated stocks". It sounds right, and it is the most common mistake in pairs trading.
What correlation measures
Correlation looks at daily returns. A correlation of 0.9 means that on days when A goes up, B usually goes up too. It says nothing about whether the two price levels stay close over months. Two stocks can rise together on most days while one grows 2% a year faster than the other. Their correlation is high, yet the gap between them widens forever. Trading that gap would mean shorting the winner over and over.
What cointegration measures
Cointegration asks a different question: is there a combination of the two prices that keeps coming back to a stable level? If ln(A) − β · ln(B) is stationary, the prices are tied together. They can wander, but not away from each other for long. That is exactly the property a mean-reversion trade relies on.
How it is tested
The classic method is the Engle–Granger two-step test:
- Regress ln(A) on ln(B) to estimate the hedge ratio β and the intercept α.
- Test the residuals, the spread, for a unit root with an Augmented Dickey–Fuller (ADF) test. A small p-value (for example below 0.05) is evidence that the spread is stationary.
Arbitrading reports both the Engle–Granger p-value and the ADF p-value of the spread for every pair it tracks.
The multiple-testing trap
If you test 1,000 random pairs at the 5% level, you should expect around 50 of them to "pass" by pure luck. Two defences help:
- Only test pairs that make economic sense, such as companies in the same industry or ETFs tracking similar assets. Arbitrading forms pairs only inside such groups.
- Control the false discovery rate. The Benjamini–Hochberg procedure turns raw p-values into q-values that account for how many tests were run. A low q-value is stronger evidence than a low p-value on its own.
Cointegration is not forever
A test on the last year of data describes the last year. Relationships change, so it is worth re-testing regularly and watching for a pair whose ADF p-value starts to climb. Arbitrading flags a "cointegration broke" event when that happens to a stretched pair.