Quant GT
Browse all lessons
Section 15 · Lesson 15.4

Cointegration and Pairs Trading

When non-stationary series move together in the long run.

Two non-stationary series XtX_t and YtY_t are cointegrated if some linear combination Xt−βYtX_t - \beta Y_t is stationary. Each series wanders, but they wander together.

Cointegrated pairs are the foundation of statistical arbitrage. If log⁡PA\log P_A and log⁡PB\log P_B are cointegrated with hedge ratio β\beta, the spread log⁡PA−βlog⁡PB\log P_A - \beta \log P_B is stationary and mean-reverting. When the spread widens, sell the rich asset and buy the cheap one; when it reverts, close the position.

Practical pipeline: pre-screen pairs, test for cointegration (Engle-Granger or Johansen test), estimate the hedge ratio, model spread dynamics (often AR(1) or Ornstein-Uhlenbeck), and trade when the spread crosses entry/exit thresholds expressed in standard deviations.

Limits: cointegration relationships break. Companies merge, regulations change, structural breaks appear. Successful pairs traders monitor for changes in the cointegration relationship and exit when it deteriorates.