Time Series, lesson 9
Cointegration and pairs
Two prices that wander together, and trading the gap.
You know stationarity, the Dickey-Fuller test and mean reversion.
Part 1. Find the hedge ratio
Below are two simulated stocks that share one random driver, plus some noise of their own. Each one wanders. Find the mix of the two that doesn't.
Around A − 1.5 × B the shared driver cancels, and what's left has nothing to wander with. Two unrelated walks, by contrast, can drift the same way for a long time by chance and correlate strongly, yet no mix of them settles.
Cointegration, hedge ratio and spread
Two series are cointegrated when each has a unit root but some combination A − βB is stationary. β is the hedge ratio, and A − βB is the spread. Correlation is about whether daily moves line up. Cointegration is about whether the levels stay tied.
Your turn
Two stocks' prices have a correlation of 0.95 over five years. What can you conclude about trading their spread?
Part 2. Testing and trading the gap
Keep going with Pro
You've done the first part. Pro opens the rest of this lesson, and every other one.
- Testing and trading the gap
- A worked problem
- The same thing, for real
Time Series overviewSpotted a mistake? Tell us.