Trading strategies·stat-arb

Pairs trading & cointegration

commoditised
Reviewed 4 June 2026. As of 2026: widely known and implemented; the edge is in execution, not the idea.

The simplest stat arb: find two cointegrated names, and when their spread diverges, short the rich and buy the cheap, betting on reversion. The z-score triggers entry and exit. Competed away in liquid equities; a clean teaching case everywhere.

See it move

Cointegration z-score tradedrag the thresholdIX-COINT
Entry threshold±2.0σ
Round-trips1
Now-0.39σ
short the spreadlong the spread
Entry z-score2.0σ

What to notice. The spread between two cointegrated names is stationary: it wanders but reverts. Trade it when it's stretched past ±2.0σ and exit at the mean. Tighten the threshold for more round-trips and more cost; widen it for fewer, cleaner ones.

What is a pairs trade?

A pairs trade is a market-neutral position: long one instrument, short a related one, sized so the combination is a mean-reverting spread. You profit when the spread closes (the relatively cheap leg catches up and the relatively rich leg falls back) regardless of which way the market moves. It is the simplest, most famous instance of statistical arbitrage.

Intuition first. Pick two names that move together for a real reason: two airlines, two payment networks, an ETF and a near-substitute. When one drifts cheap relative to the other with no fundamental cause, you buy the cheap one and short the rich one. When they re-converge you unwind, pocketing the gap. Because you are long and short, a market-wide move cancels; you only care about the relative move, not the level of the market.

The position is +1+1 unit of A and β-\beta units of B, where β\beta is the hedge ratio that makes the combination market-neutral and the spread stationary. The strategy is attributed to Nunzio Tartaglia's quant group at Morgan Stanley in the mid-1980s; the academic reference point is Gatev, Goetzmann & Rouwenhorst (2006), who documented the distance-based version's historical returns and their subsequent decay.

The spread is a single number: the price of A minus the hedge ratio times the price of B (plus an intercept). You stop watching two prices and start watching one mean-reverting quantity.
St  =  PA,t    βPB,t    αS_t \;=\; P_{A,t} \;-\; \beta\,P_{B,t} \;-\; \alpha

Correlation is not enough: you need cointegration

Correlation measures whether two series move together period to period; it can be high by coincidence with no force pulling them back together. Cointegration is stronger: a linear combination of the two price levels is stationary: it has a fixed mean it reverts to. Pairs trading needs cointegration, because only a stationary spread is reliably mean-reverting.

The trap is the spurious regression (Granger & Newbold 1974): two independent random walks can show high rolling correlation over a sample purely by chance. Trade their "spread" and you are trading noise with no reversion: it drifts off and never comes back. Correlation of returns says nothing about whether the price levels stay tethered. That is the single most important thing to internalise on this page.

Cointegration (Engle & Granger 1987) is the property you actually want: two non-stationary series PAP_A, PBP_B (each a random walk, integrated of order one, I(1)I(1)) are cointegrated if some combination PAβPBP_A - \beta P_B is stationary (I(0)I(0)): it fluctuates around a constant mean and reverts. That stationary combination is your tradable spread. The economic story is a shared stochastic trend (the common factor) plus a mean-reverting deviation.

Two prices are cointegrated when a fixed weighting of them strips out the common trend and leaves a stationary residual: that residual is the spread you trade. Correlation looks at co-movement; cointegration looks at whether the gap between them is tethered.
PA,t,PB,tI(1),et=PA,tβPB,tαI(0)P_{A,t},\,P_{B,t}\sim I(1), \qquad e_t = P_{A,t} - \beta\,P_{B,t} - \alpha \sim I(0)

The standard, simplest test is the Engle–Granger two-step. First, estimate the cointegrating relationship by OLS: regress PAP_A on PBP_B to get the hedge ratio β^\hat\beta and the residual e^=PAβ^PBα^\hat e = P_A - \hat\beta P_B - \hat\alpha. Second, test that residual for stationarity with an Augmented Dickey–Fuller (ADF) test: if you reject the unit-root null, the residual is stationary, the pair is cointegrated, and e^\hat e is your spread. Three caveats stated plainly. The test is in-sample and direction-dependent (regressing A on B versus B on A gives slightly different β\beta); the Johansen test handles multiple series and is symmetric; and multiple-testing kills you: scan 5,000 pairs at p<0.05p\lt 0.05 and roughly 250 pass by chance. Out-of-sample re-validation and an economic prior for why the pair should cointegrate are non-negotiable (see backtesting & simulation).

Show the derivation: Engle–Granger and the stationary spread optional

Let each price be a random walk with a unit root, so the change is stationary but the level is not. They are cointegrated if a weighting (1,β)(1,-\beta) makes the residual stationary.

PA,t,PB,tI(1),et=PA,tβPB,tαI(0)P_{A,t},\,P_{B,t}\sim I(1), \qquad e_t = P_{A,t} - \beta\,P_{B,t} - \alpha \sim I(0)

The Granger Representation Theorem then guarantees an error-correction model: when the spread is positive (A rich), A's expected change is negative, pulling the spread back. The negative loading γA<0\gamma_A \lt 0 on last period's spread is the mathematical statement of "the spread reverts".

ΔPA,t  =  γAet1  +  (short-run terms)  +  εA,t,γA<0\Delta P_{A,t} \;=\; \gamma_A\, e_{t-1} \;+\; (\text{short-run terms}) \;+\; \varepsilon_{A,t}, \qquad \gamma_A \lt 0

Step 1 estimates (α,β)(\alpha,\beta) by OLS, super-consistent under cointegration. Step 2 runs ADF on the estimated residual: regress its change on its lag plus lagged differences, and test the unit-root null against a negative root.

Δe^t  =  ρe^t1  +  iϕiΔe^ti  +  ut,H0:ρ=0   vs   ρ<0\Delta \hat e_t \;=\; \rho\,\hat e_{t-1} \;+\; \sum_i \phi_i\,\Delta \hat e_{t-i} \;+\; u_t, \qquad H_0:\rho=0 \;\text{ vs }\; \rho\lt 0

Crucially, use the Engle–Granger critical values, not the standard ADF ones, because the residual is estimated, which shifts the test's distribution. Skip this and you will reject the null too readily and trade spurious pairs.

The spread, the hedge ratio and the z-score: entry and exit

Once you have a stationary spread, you standardise it into a z-score: how many standard deviations the spread sits from its rolling mean. You enter when z|z| is large (the spread is far from fair) and exit as zz returns toward zero. The z-score turns "how mispriced" into a tradable signal that is comparable across pairs and across time.

The hedge ratio β\beta is the OLS slope from the cointegrating regression: how many units of B offset one unit of A so the combination is neutral. It must be re-estimated on a rolling basis; a drifting β\beta is an early warning that the relationship is changing under you.

Standardise the spread by its own rolling mean and standard deviation. A z of plus two means the spread is two standard deviations rich; a z of zero means it is at fair value.
zt  =  StμSσSz_t \;=\; \frac{S_t - \mu_S}{\sigma_S}

The typical rules follow directly. Enter short the spread (sell A, buy β\beta units of B) when z+zentryz \ge +z_{\text{entry}}, say +2+2. Enter long the spread (buy A, sell β\beta units of B) when zzentryz \le -z_{\text{entry}}. Exit when zz crosses back through zexitz_{\text{exit}} (often zero, sometimes ±0.5\pm 0.5) taking the reversion. And stop when zzstop|z| \ge z_{\text{stop}} (say 3 to 4) because the spread is not reverting, and you cut before it becomes a regime break.

The threshold trade-off is the heart of the design. A wider entry band (z=2.5z=2.5) means fewer, larger, higher-conviction trades but rarer signals and longer holds; a narrower band (z=1.0z=1.0) means more, smaller trades that more easily fail to clear costs. The optimum depends on the half-life, the spread volatility, and round-trip costs on both legs: push zentryz_{\text{entry}} down to chase more trades and you destroy net P&L once costs bite.

The half-life: how fast does the spread revert? (Ornstein–Uhlenbeck)

The half-life is the expected time for a deviation to shrink by half: your holding period and your capital-turnover. Model the spread as an Ornstein–Uhlenbeck process (continuous-time mean reversion), fit its speed θ\theta, and the half-life is ln2/θ\ln 2 / \theta. A half-life of hours means fast intraday turnover; weeks means slow turnover and more exposure to a regime break.

Intuition: the spread is a spring. The stiffer the spring (the faster the mean reversion) the quicker a stretched spread snaps back. The half-life puts a number on "how quickly", and so tells you how long your capital is tied up per trade and how many independent bets you get per year.

The OU process pulls the spread back toward its long-run mean at speed theta, buffeted by noise. The half-life (the time for a deviation to halve) is the natural log of two divided by that speed.
dSt=θ(μSt)dt+σOUdWt,t1/2=ln2θdS_t = \theta(\mu - S_t)\,dt + \sigma_{\text{OU}}\,dW_t, \qquad t_{1/2} = \frac{\ln 2}{\theta}

Fitting it is a one-line regression. Discretise the OU process to an AR(1) form, ΔSt=a+bSt1+εt\Delta S_t = a + b\,S_{t-1} + \varepsilon_t; then θb/Δt\theta \approx -b/\Delta t and t1/2=ln2Δt/bt_{1/2} = -\ln 2 \cdot \Delta t / b. A more negative bb means faster reversion and a shorter half-life. This is the same regression as the ADF test: stationarity and reversion speed are two readings of one fit. Why it gates profitability: each round-trip captures roughly the spread's standard deviation, and you get about one independent bet per half-life, so annual gross is roughly bets-per-year times the per-bet sigma. A 3-day half-life on a sigma that clears costs is tradable; a 6-week half-life means about eight bets a year and heavy exposure to the relationship breaking mid-trade.

Show the derivation: OU half-life from the discrete fit optional

The OU SDE has an exact discrete solution: the next value is a weighted blend of the long-run mean and the current value, with the weight on the current value an exponential decay, plus mean-zero noise.

St+Δt  =  μ(1eθΔt)  +  eθΔtSt  +  ηtS_{t+\Delta t} \;=\; \mu\bigl(1 - e^{-\theta\Delta t}\bigr) \;+\; e^{-\theta\Delta t}\,S_t \;+\; \eta_t

Match this to the AR(1) regression St+Δt=a+φSt+ηtS_{t+\Delta t} = a + \varphi\,S_t + \eta_t. The autoregressive coefficient is exactly the decay factor, so the speed falls straight out as a log.

φ=eθΔt    θ=lnφΔt\varphi = e^{-\theta\Delta t} \;\Longrightarrow\; \theta = -\frac{\ln \varphi}{\Delta t}

A deviation decays as eθτe^{-\theta\tau}; set that equal to one half and solve for the half-life. In practice fit the difference form ΔSt=a+bSt1+εt\Delta S_t = a + b\,S_{t-1} + \varepsilon_t (so φ=1+b\varphi = 1+b); for small bb, the speed is approximately b/Δt-b/\Delta t.

eθτ=12    τ=ln2θ    ln2Δtbe^{-\theta\tau} = \tfrac{1}{2} \;\Longrightarrow\; \tau = \frac{\ln 2}{\theta} \;\approx\; -\frac{\ln 2 \cdot \Delta t}{b}

What kills a pairs trade? Regime break and crowding

Two things kill it. A regime break: the cointegrating relationship stops holding (a merger, a sector shock, a constituent change) and the spread diverges instead of reverting, blowing through your stop. And crowding: so many traders chase the same spread that deviations shrink below costs. Both are why relative-value P&L is negatively skewed: many small wins, occasional large losses.

Regime break is the tail risk. Cointegration is an estimated, historical property, not a law. When the economic link changes (one airline gets acquired, a payment network loses a partner, an index reconstitutes) the spread that always reverted now trends. Your z-score keeps screaming "enter" as you bleed. This is why a hard stop and a rolling re-test of cointegration are mandatory, and why position sizing must survive the spread not reverting.

Crowding is alpha decay. A public spread attracts capital; capital arbitrages deviations faster and smaller (see capacity & alpha decay). The gross deviation you could once capture shrinks until it no longer clears round-trip costs on both legs, which is precisely why the classic equity pairs trade is dead in liquid names. Layered on top is cost asymmetry: every trade pays the spread, fees and market impact on two legs, twice (in and out), and shorting adds borrow cost and recall risk. A spread that looks profitable gross is routinely unprofitable net; costs are the first thing to model, not the last.

The systemic version: when many leveraged relative-value books hold the same spreads and one delevers, the forced unwind moves every shared spread the wrong way at once. Diversifying across pairs does not protect you when the same players crowd them all.
skew[P&L]<0:many small wins    rare large losses (the break)\text{skew}\bigl[\text{P\&L}\bigr] \lt 0:\quad \text{many small wins} \;-\; \text{rare large losses (the break)}

The canonical case is the August 2007 "quant quake" (Khandani & Lo 2007): crowded equity-neutral books all delevered into the same names at once, and supposedly diversified, market-neutral portfolios took correlated, double-digit losses in days. The lesson is that your real risk is not any single pair but the population of traders holding your pairs.

Worked example

A pairs trade on a synthetic cointegrated pair, as of 2026, with illustrative numbers. The cointegrating regression gives hedge ratio β=0.8\beta = 0.8 and intercept near zero, so the spread is S=PA0.8PBS = P_A - 0.8\,P_B. Over the 60-day fit window the spread has mean μ=0\mu = 0 and standard deviation σ=0.40\sigma = 0.40. The AR(1) fit gives b=0.23b = -0.23 per day, so θ0.23\theta \approx 0.23 per day and the half-life is ln2/0.233.0\ln 2 / 0.23 \approx 3.0 days. Rules: enter at z2|z| \ge 2, exit at z=0z = 0, stop at z3.5|z| \ge 3.5.

The good trade. The spread widens to S=+0.80S = +0.80, so z=+2.0z = +2.0. You sell 1 A and buy 0.8 B, shorting the spread. Three days later (one half-life) the spread reverts to S=0S = 0 (z=0z = 0); you unwind. Gross is about 0.800.80 per unit of spread, market-neutral throughout.

The net check: four spread-crossings of cost (two legs, in and out) at 0.10 each is 0.40 of cost, leaving 0.40 net. A z = 1.0 entry would gross only 0.40 and net zero, which is exactly why chasing more trades by lowering the band destroys the edge.
net=0.80gross4×0.10cost=0.40,at z=1.0:  0.400.40=0.00\text{net} = \underbrace{0.80}_{\text{gross}} - \underbrace{4\times 0.10}_{\text{cost}} = 0.40, \qquad \text{at } z=1.0:\; 0.40 - 0.40 = 0.00

The bad case. Instead of reverting, the spread keeps widening to S=+1.40S = +1.40 (z=3.5z = 3.5) and the stop fires for a loss of about 0.600.60 gross plus costs. A subsequent re-test shows the ADF residual is no longer stationary: the relationship broke (a corporate action on B). The correct behaviour is to stop trading the pair, not "average down": the negative skew lives exactly here, and adding to a broken spread is how a small loss becomes a blow-up. The live IX-COINT explorer above lets you set β\beta, σ\sigma, the reversion speed and the z-bands and read the half-life and net P&L directly. Real hedge ratios, volatilities, half-lives and costs must be measured per pair and dated. These figures are synthetic, educational only, and not investment advice.

Where this fits

Common questions

What is pairs trading?
Pairs trading is the simplest statistical arbitrage: find two instruments whose prices move together (ideally cointegrated, not merely correlated), and when their spread diverges, short the rich one and buy the cheap one, expecting the spread to revert. Entry and exit are usually triggered by the spread’s z-score. The classic edge is heavily competed in liquid equities; the method remains a clean teaching case and lives on in newer venues.