Trading strategies·stat-arb

Pairs trading & cointegration

≈commoditised
By . Reviewed 22 October 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.46σ
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, whichever way the market moves. It is the simplest and best-known case of statistical arbitrage.

Pick two names that move together for a real reason, such as two airlines, two payment networks, or an ETF and a near-substitute. When one drifts cheap against the other with no fundamental cause, you buy the cheap one and short the rich one, then unwind when they converge. Because you are long and short, a market-wide move cancels. Only the relative move matters.

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. Gatev, Goetzmann and Rouwenhorst (2006) trace the practice to Nunzio Tartaglia's quantitative group at Morgan Stanley in the mid-1980s. They report that the group made about $50 million in 1987 and was disbanded in 1989 after a couple of poor years. Their own test used daily US data from 1962 to 2002 and a simple distance rule: match stocks whose normalised prices move closely together, open a pair when the gap reaches two historical standard deviations, close it when the prices next cross. Top pairs earned average annualised excess returns of up to 11%, above conservative estimates of transaction costs.

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 tells you whether two series move together period to period, and it can be high by coincidence with nothing pulling the prices back together. Cointegration is stronger: a linear combination of the two price levels is stationary, with a fixed mean it reverts to. Only a stationary spread is reliably mean-reverting, so that is what a pairs trade needs.

The trap is the spurious regression. Granger and Newbold (1974) showed that if you regress one random walk on a completely unrelated one, you will often get a high R² and a "significant" slope. Trade the residual as if it were a spread and you are trading noise that drifts off and never returns. Correlation of returns says nothing about whether the price levels stay tethered.

Engle and Granger (1987) gave the standard definition. 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)). That stationary combination is the tradable spread. The economic picture is a shared stochastic trend plus a mean-reverting deviation. Note that Gatev et al. did not use cointegration; their distance method is a separate, simpler way to pick pairs.

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,t∼I(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 simplest test is the Engle–Granger two-step. First, estimate the 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, run an Augmented Dickey–Fuller (ADF) test on that residual. If you reject the unit-root null, the residual is stationary and e^\hat e is your spread. Three limits apply. The test is in-sample and direction-dependent, since regressing A on B gives a slightly different β\beta from B on A. Johansen (1988) extends cointegration testing to more than two series and treats them symmetrically, which is what you need for baskets. And multiple testing bites hard: scan 5,000 pairs at p<0.05p\lt 0.05 and about 250 will pass by chance. Re-validate out of sample and insist on an economic reason the pair should be tied together (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,t∼I(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, proved in Engle and Granger (1987), 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  =  γA et−1  +  (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^t−1  +  ∑iϕi Δe^t−i  +  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

Use the Engle–Granger critical values rather than the standard ADF ones. The residual is estimated, which shifts the distribution of the test statistic, and the standard values would make you reject the null too readily and accept spurious pairs.

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

You standardise the spread into a z-score, the number of standard deviations it sits from its rolling mean, enter when ∣z∣|z| is large and exit as zz returns toward zero. The z-score makes "how mispriced" 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. Re-estimate it 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 rules follow directly. Short the spread (sell A, buy β\beta units of B) when z≥+zentryz \ge +z_{\text{entry}}, say +2+2, which is the same two-deviation trigger Gatev et al. used. Go long the spread (buy A, sell β\beta units of B) when z≤−zentryz \le -z_{\text{entry}}. Exit when zz crosses zexitz_{\text{exit}}, often zero and sometimes ±0.5\pm 0.5. Stop out when ∣z∣≥zstop|z| \ge z_{\text{stop}}, say 3 to 4, because a spread that keeps widening is not reverting and you want to be out before it becomes a regime break.

Avellaneda and Lee (2010) test a variant on US equities: they model each stock's residual against a factor model as a mean-reverting process, convert it to an "s-score", open at an absolute score above 1.25, and close longs at −0.50 and shorts at 0.75. They estimate over a 60-day window, keep only names whose reversion time is under half that window, and charge 5 basis points a trade. The point for any design is the same: asymmetric bands and a cost assumption belong in the rules from the start.

The threshold trade-off is the core of the design. A wide entry band (z=2.5z=2.5) gives fewer, larger trades and longer holds. A narrow band (z=1.0z=1.0) gives more, smaller trades that struggle to clear costs. The best choice depends on the half-life, the spread volatility and the round-trip cost on both legs. Push zentryz_{\text{entry}} down to chase more trades and net P&L falls once costs bite, as the worked example shows.

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, and it sets your holding period and your capital turnover. Model the spread as an Ornstein–Uhlenbeck process, fit its speed θ\theta, and the half-life is ln⁡2/θ\ln 2 / \theta. Elliott, van der Hoek and Malcolm (2005) use this kind of mean-reverting model, observed with noise, as the standard academic treatment of the pairs spread. A half-life of hours means fast turnover. A half-life of weeks means slow turnover and more exposure to a break.

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+σOU dWt,t1/2=ln⁡2θdS_t = \theta(\mu - S_t)\,dt + \sigma_{\text{OU}}\,dW_t, \qquad t_{1/2} = \frac{\ln 2}{\theta}

Fitting it takes one regression. Discretise the process to AR(1) form, ΔSt=a+b St−1+εt\Delta S_t = a + b\,S_{t-1} + \varepsilon_t, and then θ≈−b/Δt\theta \approx -b/\Delta t and t1/2=−ln⁡2⋅Δt/bt_{1/2} = -\ln 2 \cdot \Delta t / b. A more negative bb means faster reversion. This is the same regression as the ADF test: stationarity and reversion speed are two readings of one fit. The half-life gates profitability because you get roughly one independent bet per half-life, and each round trip captures about one spread standard deviation. A 3-day half-life on a spread whose sigma clears costs is tradable. A 6-week half-life gives about eight bets a year (52 divided by 6 is 8.7) and a long 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  =  μ(1−e−θΔt)  +  e−θΔt St  +  η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+b St−1+ε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  ⟹  τ=ln⁡2θ  ≈  −ln⁡2⋅Δ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, crowding and costs

Three things: a regime break, crowding, and costs. The first is sudden, the second gradual, and the third is always present. Together they explain why relative-value P&L is negatively skewed, with many small wins and an occasional large loss.

Regime break is the tail risk. Cointegration is an estimated, historical property, not a law. When the economic link changes (one airline is acquired, a payment network loses a partner, an index reconstitutes), the spread that always reverted starts to trend, and the z-score keeps signalling "enter" while you lose money. A hard stop, a rolling re-test of cointegration, and position sizes that survive the spread not reverting are all mandatory.

Crowding and rising risk shrink the edge. Do and Faff (2010) extended the Gatev et al. test to June 2009. The mean monthly excess return of the top 20 pairs fell from 0.86% in 1962–1988 to 0.37% in 1989–2002 and 0.24% in 2003–2009. They attribute up to 70% of the decline to rising arbitrage risks rather than competition alone, and the strategy still did well in the 2000–02 bear market and the 2007–09 crisis. So the simple distance trade has shrunk to a fraction of its early returns without disappearing. Capital arbitrages deviations faster and smaller (see capacity & alpha decay), until the gross gap no longer clears costs.

Costs are paid four times. Every trade pays the spread, fees and market impact on two legs, in and out, and shorting adds borrow cost and recall risk. A spread that looks profitable gross is routinely unprofitable net, so model costs first rather than 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 crowding event is the August 2007 "quant quake". Khandani and Lo (2011) document two unwinds of equity market-neutral positions, on 1 August 2007 (10:45 to 11:30) and from the open on 6 August to 1:00pm, with losses concentrated in the week of 6 August. Many supposedly diversified portfolios lost together within days. Your real risk is not a single pair but the population of traders holding your pairs.

Worked example

A pairs trade on a cointegrated pair, using illustrative numbers. The cointegrating regression gives hedge ratio β=0.8\beta = 0.8 and intercept near zero, so the spread is S=PA−0.8 PBS = 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 ln⁡2/0.23≈3.0\ln 2 / 0.23 \approx 3.0 days. The exact discrete value is ln(0.5) / ln(0.77), about 2.7 days, so the small-b approximation overstates it slightly. Rules: enter at ∣z∣≥2|z| \ge 2, exit at z=0z = 0, stop at ∣z∣≥3.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. On average the gap halves in about three days, and in this case it snaps back to S=0S = 0 (z=0z = 0) within that time and you unwind. Gross is 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.80⏟gross−4×0.10⏟cost=0.40,at z=1.0:  0.40−0.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 widens to S=+1.40S = +1.40 (z=3.5z = 3.5) and the stop fires for a loss of about 0.600.60 gross (1.40 less 0.80) plus costs. A re-test shows the ADF residual is no longer stationary: the relationship broke after a corporate action on B. The correct response is to stop trading the pair, not to average down. Adding to a broken spread is how a small loss becomes a blow-up. The IX-COINT explorer above lets you set β\beta, σ\sigma, the reversion speed and the z-bands and read off the half-life and net P&L. Real hedge ratios, volatilities, half-lives and costs have to be measured pair by pair.

Sources

  1. Gatev, E., Goetzmann, W. N. and Rouwenhorst, K. G. (2006). "Pairs trading: Performance of a relative-value arbitrage rule". Review of Financial Studies 19(3), 797–827. doi.org/10.1093/rfs/hhj020
  2. Do, B. and Faff, R. (2010). "Does simple pairs trading still work?". Financial Analysts Journal 66(4), 83–95. doi.org/10.2469/faj.v66.n4.1
  3. Engle, R. F. and Granger, C. W. J. (1987). "Co-integration and error correction: Representation, estimation, and testing". Econometrica 55(2), 251–276. doi.org/10.2307/1913236
  4. Granger, C. W. J. and Newbold, P. (1974). "Spurious regressions in econometrics". Journal of Econometrics 2(2), 111–120. doi.org/10.1016/0304-4076(74)90034-7
  5. Johansen, S. (1988). "Statistical analysis of cointegration vectors". Journal of Economic Dynamics and Control 12(2–3), 231–254. doi.org/10.1016/0165-1889(88)90041-3
  6. Elliott, R. J., van der Hoek, J. and Malcolm, W. P. (2005). "Pairs trading". Quantitative Finance 5(3), 271–276. doi.org/10.1080/14697680500149370
  7. Avellaneda, M. and Lee, J.-H. (2010). "Statistical arbitrage in the US equities market". Quantitative Finance 10(7), 761–782. doi.org/10.1080/14697680903124632
  8. Khandani, A. E. and Lo, A. W. (2011). "What happened to the quants in August 2007? Evidence from factors and transactions data". Journal of Financial Markets 14(1), 1–46. doi.org/10.1016/j.finmar.2010.07.005

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.