insideout Get Pro

09 · Cointegration and pairs

Pro

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.

Two stocks, one spreadLive

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?

In the lab, two walks simulated separately had strongly correlated prices. Regressing one wandering series on another often looks significant when nothing links them, which is why you test the spread for a unit root.

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.

Still to come
  1. Testing and trading the gap
  2. A worked problem
  3. The same thing, for real

Time Series overviewSpotted a mistake? Tell us.