Systematic & Quant

Pairs Trading, Explained

Pairs trading tests a relationship between two assets, not a hunch that one is cheap. Define the pair, hedge rule and break condition before the chart.

Pairs trading is a relative-value method: it takes a long position in one asset and a short position in another according to a pre-defined relationship. It does not remove risk; it changes the question from “where will this market go?” to “will this relationship behave as the rule assumed?”

That distinction is the whole method. A pair can look beautifully aligned until its economic link, trading costs, hedge ratio or available borrow changes. The chart then stops being evidence and starts being a warning drawn after the fact.

What pairs trading actually trades

Pairs trading trades a spread, not simply two familiar tickers. The rule first chooses a universe and a relationship, then says exactly how to turn the two prices into a spread and what a deviation means.

The classic academic construction matched securities by historical price behaviour and traded the divergence as a self-financing relative-value rule. A later statistical-arbitrage treatment modelled residual returns after factor or sector-ETF adjustment. Those are related ideas, but they are not interchangeable rules (Gatev, Goetzmann and Rouwenhorst, Avellaneda and Lee).

choose a defined universe
        -> form pairs using a rule available at that date
        -> set the hedge rule and calculate a spread
        -> measure a pre-defined deviation
        -> enter, exit, rebalance or stop by written conditions

A pair is therefore not “two companies in the same industry.” Industry membership can be a candidate-generation idea, but the tradeable claim has to be narrower: the defined spread has a behaviour worth testing after the costs and constraints of both legs.

The hedge rule is part of the hypothesis

A hedge ratio tells the system how much of each leg belongs in the spread. Equal cash amounts, equal beta, a rolling regression estimate and a fixed historical ratio each make a different claim about what is being hedged.

ChoiceWhat it assumesWhat can go wrong
Equal notionalThe two legs can be compared at the same cash weightPrice volatility or sensitivity differs materially
Fixed hedge ratioA past relationship remains usefulThe relationship changes while the trade remains open
Rolling estimateThe relationship can be updated from recent historyThe update itself can chase noise or use information not available at entry
Factor-residual spreadCommon drivers can be removed with the chosen modelThe factor model is incomplete or unstable

The research descriptions make this modelling choice visible: the pairs rule in Gatev, Goetzmann and Rouwenhorst is not the residual-based framework in Avellaneda and Lee (Gatev, Goetzmann and Rouwenhorst, Avellaneda and Lee). Treating both as “a correlation trade” hides the part that needs testing.

Correlation is not the entry rule

Correlation says that two returns have moved together over a selected period. It does not define a stable spread, an entry threshold, a hedge ratio, or a point at which the premise has failed.

Cointegration is often used to ask a more specific statistical question about a relationship between non-stationary series. The Engle-Granger procedure is a test, not a profitability certificate: the coint implementation documents a null hypothesis of no cointegration, while the underlying trading rule still needs separate execution and out-of-sample evidence (statsmodels: cointegration test, statsmodels: augmented Dickey-Fuller test).

That is where many clean-looking examples fail. A researcher can select a pair after seeing it converge, estimate its relationship on the same history, and call the reversal a result. The live question is harsher: could the pair, estimate and trigger have been chosen on information available before the trade?

Where pairs trading breaks

Pairs trading has no automatic market-direction exposure only under its stated hedge model. It can still lose when both legs move, when the relationship changes, or when one side cannot be transacted as assumed.

The failure modes are practical rather than exotic:

  • Relationship break: a corporate event, index change, policy shift or business divergence can make old similarity irrelevant.
  • Model drift: a rolling hedge estimate may move just as the historical relationship stops holding.
  • Execution mismatch: spread, commission, slippage, financing and availability constraints apply to two legs, not one.
  • Selection bias: choosing pairs from the eventual winners gives the research future knowledge.
  • Crowded exits: a relative-value trade can become least liquid when many participants want the same exit.

Avellaneda and Lee explicitly frame statistical arbitrage as model-driven and discuss performance changing across their sample; Gatev, Goetzmann and Rouwenhorst also distinguish a historical result from the market microstructure questions around it (Avellaneda and Lee, Gatev, Goetzmann and Rouwenhorst). Neither paper is a template for a current platform, broker or market.

How you'd actually test it

Test a frozen process, not a handpicked pair. Write the specification before you inspect its outcome, then retain every rejected candidate and every pair that later stops behaving.

Test componentWhat to lock down before results
UniverseEligible instruments, point-in-time membership, corporate actions and unavailable symbols
Pair formationSimilarity or economic rule, formation window, reselection schedule and tie handling
SpreadPrice transformation, hedge-ratio method, estimation data and update timing
SignalDeviation measure, threshold, entry timestamp, exit, stop and maximum holding time
Trading realityBid-ask costs, commission, slippage, financing, short availability and leg-order handling
EvaluationIn-sample design period, untouched out-of-sample period and nearby-specification checks

Run the same machinery on all eligible candidates, not only the names that look intuitive. In particular, form and re-form pairs using only information available at each historical date. Why cross-validation leaks in trading explains why an apparently careful validation can still share future information; how to verify a cTrader backtest covers the complementary question of whether the executable assumptions match the reported result.

realbacktesting is a trading-software studio for cTrader built around verifiable work. Its published cBot figures are cTrader-native backtests that readers can reproduce in their own cTrader. The comparable standard for a pairs study is modest but demanding: make the universe, pair formation, hedge rule, costs and failures reproducible before treating the curve as evidence.

Frequently asked

Is pairs trading market neutral?

Pairs trading can be designed to reduce a chosen form of market exposure, but “market neutral” depends on the hedge rule and the risk model. A long-short position can still carry sector, factor, liquidity, currency, gap and relationship-break risk.

Is correlation enough to select a trading pair?

No. Correlation is a descriptive statistic over a chosen sample. A pairs rule still needs a defined spread, hedge method, entry and exit conditions, and a test that respects when each input was known.

Is cointegration proof that a pairs trade will work?

No. Cointegration is evidence about a statistical relationship under a test's assumptions. It does not establish tradability after costs, a stable hedge ratio, or survival in a new market regime.

The stubborn takeaway

A pairs trade is only as systematic as its relationship rule. If the pair is chosen after the convergence is visible, the backtest is not relative value; it is hindsight split across two charts.

Published Sep 25, 2026 · realbacktesting · Educational content and market commentary — not financial advice. Trading involves risk; past performance does not guarantee future results.