Statistics for quants

Cointegration and pairs trading

4 min

Two prices can each wander unpredictably yet stay tethered to each other over time. When the spread between them is stationary even though each price is not, the pair is cointegrated. This is the statistical engine behind pairs trading and much of statistical arbitrage.

The idea

Consider two related companies — say two large oil majors, or a stock and its sector ETF. Their prices drift all over the place, but the economics that link them keep them moving roughly together. The difference between them oscillates around a stable level.

Cointegration is not the same as correlation. Two series can be highly correlated day to day yet drift apart forever; cointegration is the stronger statement that a particular combination of them is mean-reverting.

How pairs trading uses it

  1. Find a cointegrated pair and measure the historical spread.
  2. When the spread stretches unusually wide, bet it will close: go long the cheap leg, short the expensive leg.
  3. When the spread reverts to its mean, close both legs for a profit.

The position is market-neutral — long one, short the other — so broad market moves roughly cancel and you are betting only on the relationship reverting.

Why it is harder than it looks

  • Cointegration can break. A merger, a scandal, a structural change and the historical relationship simply ends — the spread keeps widening and never reverts. This is how pairs strategies blow up.
  • The relationship must be re-tested constantly, never assumed permanent.
  • Crowding: when many funds trade the same obvious pairs, the edge thins and the unwinds get violent.

Pairs trading is elegant and genuinely used, but it is a bet that the past relationship persists — a bet that periodically and painfully fails.

Finished reading?
Risk disclaimer

This content is for educational and informational purposes only and is not investment, financial, tax or legal advice. Trading and investing carry risk, including the possible loss of capital. Any performance shown by third-party tools is hypothetical and not a promise of future results. Do your own research and consider professional advice before making any decision.