Pro Desk

Pairs Trading and Statistical Arbitrage

A pair trade is a bet that a computed spread reverts. Here is the regression that gives you the hedge ratio, the z-score that gives you the entry, and the reasons the relationship stops holding.

AI-assisted, reviewed and edited by John James. How we use AI

7 min read

Screen a liquid universe for stock pairs with a daily return correlation above 0.9 and you will get hundreds of candidates in a few seconds. Most of them will lose money. The screen is measuring the wrong thing, and the gap between what it measures and what a pair trade requires is the first piece of arithmetic worth getting right.

A pair trade makes one claim: a specific linear combination of two prices has a stable mean, and deviations from that mean decay. Everything after that is implementation. The claim is testable, the entry is computable, the holding period is estimable, and the failure modes are mostly visible in advance, which makes this one of the few strategies where the risk analysis and the trade analysis use the same spreadsheet. Half of every pair is a short. How short selling works mechanically is a prerequisite.

Correlation is measured on the wrong series

Correlation is computed on returns. It says that when one stock rises 1 percent the other tends to rise about 1 percent as well. It says nothing at all about levels.

Two stocks can post a 0.95 return correlation across three years while one compounds at 20 percent and the other at 4 percent, so the ratio between their prices drifts steadily in one direction for the whole period, and a mean reversion trade on a drifting spread is a slow, well correlated loss.

Cointegration is the property the trade actually needs. Two price series are cointegrated when some linear combination of them is stationary, which means it has a stable mean and variance and pulls back after a shock. The Engle Granger procedure is the standard first pass: regress one price on the other, take the residuals, and run an augmented Dickey Fuller test to see whether they revert.

The regression that gives you the hedge ratio

Regress the price of A on the price of B over a lookback window, say 120 trading days:

A_t = alpha + beta x B_t + e_t

Suppose that comes back with beta = 1.35. You hold 1.35 units of B against every unit of A, and the series you are going to trade is

S_t = A_t - 1.35 x B_t

Two choices inside that are more consequential than the regression itself. The lookback window controls how fast the hedge ratio adapts, and a short window chases noise while a long one carries a stale relationship straight through a genuine change in the business. And the direction matters, because regressing B on A gives a slope that is not the reciprocal of 1.35, though total least squares removes the asymmetry and fixing a convention and never deviating from it works nearly as well.

The entry, worked end to end

A trades at 82.40 and B at 60.00, so

S = 82.40 - 1.35 x 60.00 = 82.40 - 81.00 = 1.40

Over the last 60 days that spread averaged 0.20 with a standard deviation of 0.45, which makes the standardized deviation

z = (1.40 - 0.20) / 0.45 = 1.20 / 0.45 = 2.67

At z = 2.67 the spread is historically wide, so the trade sells the rich leg and buys the cheap one. Short 1,000 shares of A. Hedge with 1,000 x 1.35 = 1,350 shares of B.

Leg Shares Price Notional
Short A 1,000 82.40 $82,400
Long B 1,350 60.00 $81,000
Net exposure $1,400 short

Close to dollar neutral, so a 2 percent move in the whole market shifts the position by roughly $28 while an unhedged short of A alone would move about $1,600. That is the entire point of the hedge ratio, and it is the reason the number matters more than the entry threshold does.

Exit at z = 0, where the spread returns to 0.20. The gain is 1.40 - 0.20 = 1.20 per share of A, or $1,200. Stop at z = 4.0, where the spread reaches 0.20 + 4.0 x 0.45 = 2.00, for a loss of (2.00 - 1.40) x 1,000 = $600. Two to one reward against risk, on a thesis that is pure arithmetic.

Two standard deviations is the conventional entry, with exits at zero or half a standard deviation and stops between three and four, and those are conventions, not optimal values, so anyone telling you 2.1 is materially better than 2.0 has overfitted something. The discipline that matters is choosing the numbers before the backtest.

How long the trade should take

Mean reversion speed is estimable. Estimating it is what separates a pair trade from a hope. Regress the daily change in the spread on its own lagged level:

dS_t = a + b x S_(t-1)

With b = -0.15, the half-life of a deviation is

half-life = -ln(2) / ln(1 + b) = -0.6931 / ln(0.85) = -0.6931 / -0.16252 = 4.3 days

So a spread sitting at z = 2.67 should be near z = 1.34 in about four trading sessions. That single number sets your expected holding period, your financing cost estimate, and your warning system.

Costs decide the outcome, not the signal

Gross spreads in liquid pairs are thin. Costs are the difference between a strategy and a hobby.

Execution comes first. Four legs across entry and exit, each paying at least half the quoted spread: on the position above, a one cent effective half spread on both legs of both transactions costs roughly (1,000 + 1,350) x 0.01 x 2 = $47 against a $1,200 target. Fine in these names. Ruinous in a pair quoted five cents wide. Microstructure sets the investable universe before any statistics are run.

Borrow on the short leg comes second. The range is enormous. At an easy to borrow rate of 0.50 percent annualized on $82,400 for 12 days, 82,400 x 0.005 x 12/360 = $13.73, which is noise, but at a hard to borrow rate of 25 percent it is 82,400 x 0.25 x 12/360 = $686, which eats more than half the target gain before the spread moves at all. Check it in the short selling calculator before assuming a pair is tradeable.

Recall risk comes third and has no price. A lender who recalls mid trade leaves you bought in that afternoon at whatever price exists, with a perfect hedge on an irrelevant thesis.

From one pair to a book

A single pair is a concentrated bet on one relationship holding, and statistical arbitrage runs hundreds of them, each small, so that any one relationship failing is absorbed by the average behaviour of the rest.

That changes the management problem. Pairs inside one sector share a risk factor, so forty regional bank pairs is one bet on regional banks wearing forty tickets. Run candidate spreads through the correlation matrix, cap exposure to any sector or factor cluster, and size each pair with the fractional approach from the Kelly guide, where the correct fraction is small because the estimated edge per trade comes with standard errors wide enough to contain zero.

Why pairs break

Corporate events are the cleanest failures and the fastest. One company gets acquired and its price locks to a deal ratio, which kills the relationship in a single session, and a divestiture changes the business mix so the historical hedge ratio now describes a company that no longer exists. An accounting problem at one name produces a permanent repricing, which is a good reason to run the earnings quality checks on both legs before trading them.

Statistics are the subtler failure. Test enough combinations and some will pass a cointegration test by luck. Screening 500 stocks generates about 125,000 candidate pairs, and at a 5 percent significance level you should expect several thousand false positives before anyone has looked at a chart. The defenses are an economic reason the pair exists that you can state in one sentence, an out of sample test, and a hard cap on how many candidates you examine at all. Dual share classes of the same company, two refiners with similar crude slates, an index constituent against the sector ETF that holds it: those start with a reason. A screen output starts with a coincidence.

The last failure is the documented one. The classic distance method was published, then implemented by everyone, and showed sharply weaker returns in later samples than in the original studies, so any strategy simple enough to describe in a paragraph should be expected to decay that way, and a backtest of the textbook version deserves to be treated as marketing material.

Next, short selling explained covers the leg that makes this trade market neutral, and measuring portfolio risk covers how to check whether a market neutral book is actually neutral.

Frequently asked questions

What is pairs trading?

Pairs trading takes a long position in one security and a short position in a related one, sized so the combination has little exposure to the overall market. The trade is a bet that the price relationship between the two, measured as a spread, will return to its historical average after moving away from it. It is the simplest form of statistical arbitrage and the entry rule is usually a threshold on the standardized spread.

What is the difference between correlation and cointegration?

Correlation measures whether two series move together day to day. Cointegration measures whether a particular linear combination of their price levels stays stable over time. Two stocks can be highly correlated in daily returns while drifting apart in price for years, which produces a losing pair trade despite an impressive correlation figure. Cointegration is the property a mean reverting spread actually requires.

How do you calculate the hedge ratio for a pair?

The standard approach regresses the price of one security on the price of the other over a lookback window and uses the slope coefficient as the hedge ratio. If the slope is 1.35, you hold 1.35 units of the second security against every unit of the first. The spread is then the first price minus 1.35 times the second, and that spread is the series you test for mean reversion.

What z-score should trigger a pairs trade?

Two standard deviations is the most common entry threshold, with exits at zero or at half a standard deviation and a stop somewhere between three and four. Those numbers are conventions rather than optimal values, and tightening them increases trade frequency and costs while loosening them reduces opportunity. The important discipline is choosing them before the backtest rather than after.

Does pairs trading still work?

The simple version, applied to obvious pairs in large liquid stocks, was widely arbitraged away as it became well known, and published studies of the classic distance method show returns declining sharply in later samples. Versions that survive tend to use shorter horizons, better hedges, harder to access universes, or additional signals. Treat any backtest of the textbook version with heavy suspicion.

What are the main risks in a pairs trade?

The relationship can break permanently because of a merger, a divestiture, a change in business mix or a fraud at one of the two companies. The spread can also widen far past the entry level before reverting, which forces a loss on anyone with a stop or a margin constraint. Short leg costs, including borrow fees and recall risk, can turn a profitable spread into a losing trade.