Most trades are a bet on direction: this stock will go up. Pairs trading is a bet on a relationship: these two stocks will stay close to each other, whatever the market does.
The recipe is old. Find two securities that historically move together — two big banks, two railroads, two soda makers. When the gap between them stretches unusually wide, buy the laggard and short the leader. Shorting means borrowing shares and selling them, profiting if the price falls. If the gap closes, you win on the reconvergence regardless of whether both stocks rose or both fell.
Because you're long one stock and short a similar one, broad market moves largely cancel out. That's why the approach is called market neutral. Run the same logic across hundreds of pairs at once with computers and you have statistical arbitrage, or stat arb. The catch, as we'll see, is that relationships aren't laws of physics. They're habits, and habits break.
The most common pairs-trading mistake is picking pairs by correlation. Correlation measures whether two things tend to move in the same direction day to day. Cointegration measures something stronger: whether the gap between them stays tethered to a stable level over time.
The difference matters. Two stocks can be highly correlated — both up on good days, both down on bad days — while drifting permanently apart, one simply compounding faster. Their daily dance is synchronized; their destinations aren't. A pairs trade on that duo bleeds money forever as the gap keeps widening.
A classic analogy: a drunk wandering a field with her dog on a leash. Each step is random, but the leash guarantees they never separate beyond its length. That leash is cointegration. Statisticians test for it by checking whether some combination of the two prices keeps returning to a fixed mean instead of wandering off. Formal tools exist for this, but the concept is what matters: you need a leash, not just a shared rhythm. And even a genuine leash, measured over one period, can quietly snap in the next.
Once you have a candidate pair, you track its spread: a single number capturing the gap. It might be the price of A minus a multiple of B, or the ratio of the two prices. The multiple, called the hedge ratio, is chosen so the spread has hovered around a stable average in the past.
To judge whether today's spread is unusual, traders convert it into a z-score. The z-score is the distance from the historical mean, measured in standard deviations: z equals today's spread minus the average spread, divided by the standard deviation of the spread. A z-score of 0 means the pair is at its normal gap. Plus 2 means the gap is stretched two standard deviations rich — rare, if history is a guide.
A common rulebook: enter when the z-score crosses plus or minus 2, exit when it returns near 0, and cut the trade entirely if it reaches 3.5 or 4, because a spread that stretched has probably stopped mean-reverting for a reason. Mean reversion — the tendency of a series to drift back toward its average — is the entire engine here.
Two soda makers. Stock A trades near $100, stock B near $50, and over the past two years the spread — price of A minus two times price of B — has averaged $0 with a standard deviation of $3.
Today A is at $100 and B has slipped to $47. The spread is 100 minus 94, or $6. Z-score: 6 minus 0, divided by 3, equals plus 2. A is rich relative to B by two standard deviations. The trade: short one share of A at $100, buy two shares of B at $47. Dollar exposure is roughly balanced — about $100 short against $94 long — so a market-wide rally or selloff mostly washes out.
Two weeks later, suppose B recovers to $49.50 while A drifts to $99.50. The spread is 99.50 minus 99, or $0.50 — the z-score is nearly back to 0, so you close. You made $5 on the two B shares and $0.50 on the A short: about $5.50 on roughly $100 of capital per side, before borrowing costs, trading costs, and taxes. Note what you never needed: an opinion on the market. You only needed the gap to close. That was the deal — and sometimes the gap doesn't close.
Every pairs trader eventually learns the hard truth: pairs die. The leash you measured in the data can snap in real life, and it snaps for repeatable reasons.
Structural change is the big one. Two drug makers track each other until one's blockbuster fails a trial. Two retailers converge for a decade until one's business model is disrupted. The spread blows out, and it's not coming back — what looks like the trade of the year, a z-score of 5, is actually a funeral. Mean reversion assumes the old regime still holds. Companies, unlike coins, change.
Crowding is the quieter killer. Pairs trading was famously profitable for pioneering quant desks in the 1980s; then capital piled in, and academic studies found simple pairs returns shrinking decade after decade. When many funds watch the same spreads, gaps get closed faster and smaller — and when those funds hit trouble and unwind at once, as happened during the August 2007 quant unwind, spreads widen violently in unison. A backtested edge is a photograph of competition at a point in time. The competition doesn't stay frozen because you found the photo.
If you test pairs strategies against history, a few disciplines separate a fair test from a fantasy.
Count every cost. A pairs trade has two legs, so you pay two spreads and two commissions each way, plus stock borrow fees — the rent you pay to short — which can run from trivial to brutal. Strategies that trade often and earn small amounts per trade are exactly the kind that costs quietly destroy.
Separate discovery from testing. Scan 500 stocks and you can form over 124,000 pairs — hundreds will look beautifully cointegrated by pure luck. Test on data the selection process never saw — a later time period works — and expect many lucky pairs to fall apart there. That shrinkage is the truth arriving.
Diversify across many pairs, size each small, and honor your stop-loss even when the spread argues for doubling down. The whole strategy is a bet that history rhymes. Position for the days it doesn't. None of this guarantees a profit — it just keeps single failures survivable.
Previous: Market Microstructure: How Trades Actually Happen · Next: Position Sizing and the Kelly Criterion · Financial glossary
← Back to all investing concepts