TradeLabs AILearn

Pairs Trading

Pairs trading buys one asset and shorts a related one when their spread stretches, betting it will converge. Learn pair selection, hedge ratios, z scores and risks.

Advanced4 min readUpdated 3 Oct 2026
Markdown
Read firstMean Reversion
Lesson 13 of 22

Pairs trading is a market neutral strategy that trades the relationship between two closely related assets rather than the direction of the market. When two assets that normally move together drift apart, a pairs trader buys the one that has fallen behind and shorts the one that has run ahead, expecting the gap to close. If the whole market rises or falls, the long and short positions largely offset each other, so profit depends mainly on the spread between them.

How pairs trading works#

  1. Find two related assets, such as two companies in the same industry (Coca Cola and PepsiCo are the classic example), two share classes of the same company or an ETF and its main holdings.
  2. Measure the spread between them, usually price A minus a hedge ratio times price B.
  3. Calculate how unusual the spread is with a z score. See Percentiles, Quantiles and Z-Scores.
  4. Enter when the spread is stretched, for example beyond 2 standard deviations.
  5. Exit when the spread returns to its average, or at a stop if it keeps widening.
spread = price A - (hedge ratio × price B)
z = (spread - average spread) / standard deviation of spread

Choosing pairs#

MethodIdeaStrengthWeakness
FundamentalSame industry, similar businessEconomic reason to convergeRelationships can change
CorrelationHigh historical correlation of returnsSimpleCorrelation does not mean the spread reverts
CointegrationStatistical test that the spread is stationaryDirectly tests reversionCan break; many tests lead to false positives
DistanceSmallest historical gap in normalised pricesUsed in early researchIgnores reasons for the link

Correlation measures whether returns move together day to day; cointegration measures whether the spread between prices stays bounded. Two stocks can be highly correlated yet drift apart for years. See Covariance and Correlation and Cointegration.

Hedge ratio#

The hedge ratio sets how much of asset B to short for each unit of A. It is often estimated by regressing the price of A on the price of B. A dollar neutral pair holds equal dollar amounts long and short; a beta neutral pair adjusts for differences in market sensitivity. See Regression Analysis and Alpha and Beta.

Risks#

  • Relationship breaks: a merger, scandal or change in business model can permanently separate a pair. The spread never returns and losses grow. See Structural Breaks and Regime Changes.
  • Short selling costs and risks: borrow fees, recalls and short squeezes. See Short Selling and Borrow Fees and Stock Loan Costs.
  • Spread can widen further before converging, requiring capital and nerve.
  • Crowding: in August 2007, many quantitative funds running similar market neutral strategies suffered sharp losses at the same time as positions were unwound. See Factor Timing, Crowding and Crashes.

Risk management#

  1. Use stop losses on the spread, such as a z score of 4, or a time limit.
  2. Check that a fundamental reason links the pair.
  3. Retest the relationship regularly on recent data.
  4. Trade many pairs rather than one, which moves towards Statistical Arbitrage.
  5. Watch event risk such as earnings dates for either stock.

Testing a pairs strategy#

Testing thousands of possible pairs will find some that look cointegrated by chance. Use out of sample periods and correct for multiple testing. Include borrow costs and realistic short availability. See P-Hacking and Multiple Testing and In-Sample vs Out-of-Sample Testing.

Frequently asked questions#

What is pairs trading?#

A market neutral strategy that goes long one asset and short a related one when their price relationship stretches, expecting it to return to normal.

What is the difference between correlation and cointegration in pairs trading?#

Correlation measures whether returns move together; cointegration tests whether the price spread stays stable over time, which matters more for pairs trading.

Is pairs trading risk free?#

No. The relationship can break permanently, and short positions carry borrow costs and squeeze risk.

Next, scale the idea to many assets with Statistical Arbitrage.

Sources#

  • Gatev, E., Goetzmann, W. and Rouwenhorst, K. G., Pairs Trading: Performance of a Relative Value Arbitrage Rule, Review of Financial Studies, 2006. Summary: Wikipedia, Pairs trade
Check your understanding

3 quick questions on this lesson. Get them all right to finish it.

Turn on JavaScript to take the quiz.

Finished this lesson?Sign in to save your progress across devices.
Next lessonStatistical ArbitrageStatistical arbitrage trades many small, mean reverting mispricings across a portfolio of securities. Learn how stat arb works, its models, costs and risks.

Mentioned in