EN中文
Position Math

Guides › Pairs trading explained simply

Pairs trading explained simply

A market-neutral bet on the gap between two related prices closing — not on the market going up or down.

Pairs trading means buying one asset and short-selling a closely related one at the same time, betting that the price gap between them — the spread — returns to its usual range. Because you're long and short in matched size, broad market moves roughly cancel, so you profit from the two prices converging rather than from market direction. It works only while the two assets stay statistically linked.

What this page is for

Pairs trading sounds exotic but the core idea is simple: two things that normally move together have drifted apart, and you bet they snap back. This page explains the spread, the z-score that signals an entry, why the trade is market-neutral, and the big risk — the pair breaking. Then you can size a trade on the pairs trading calculator.

How it works (the formula)

Take two assets that historically move together — often two companies in the same sector. You track the gap between their prices and normalize it:

spread  = price(A) − β × price(B)  (β = hedge ratio)
z-score = (spread − average spread) ÷ standard deviation of spread

The z-score just says how many standard deviations the gap is from its normal level. The usual playbook:

  • Entry: when the spread stretches to about z = +2 or −2, take the mean-reversion bet. If A has become expensive relative to B (z high), you short A and buy B, sized to the hedge ratio (β units of B per unit of A).
  • Exit: when the spread returns to normal (z back near 0), close both legs for the convergence profit.
  • Stop: if the spread keeps stretching past about z = +3, the relationship may have broken — cut it.

Because the long leg is hedged against the short leg in the ratio β, a rally or sell-off that lifts or drops both names largely cancels out. What's left is the spread — which is what you actually bet on.

Inputs and assumptions

  • The two assets are genuinely linked (cointegrated), not just briefly correlated.
  • A lookback window for the average spread and its standard deviation.
  • The hedge ratio β that sets how many units of B offset one unit of A.
  • Entry and exit z thresholds, plus a stop for when the link breaks.
  • You can actually borrow the short leg, and financing/borrow cost is acceptable.

Worked example 1 — a clean convergence

Two stocks A and B that trade nearly one-for-one, so β = 1. Over the last 60 days the spread (A − B) averaged $2.00 with a standard deviation of $0.50. Today A = $104, B = $101, so the spread is $3.00 — that's z = ($3.00 − $2.00) ÷ $0.50 = +2.0. A looks rich versus B, so you short 1 share of A and buy 1 share of B (hedge ratio 1 — one share against one share; all P&L below is per share).

A week later the spread reverts to its $2.00 average. Watch that the profit is the same regardless of direction:

  • Both drift down: A $104→$100 (short gains $4), B $101→$98 (long loses $3). Net +$1 per share.
  • Both drift up: A $104→$105 (short loses $1), B $101→$103 (long gains $2). Net +$1 per share.

Either way you make the $1.00 the spread narrowed by ($3.00 down to $2.00). You never needed the market to go anywhere.

Worked example 2 — when the pair breaks

Same entry: short A at $104, long B at $101, spread $3.00, z = +2. But this time the mean-reversion bet is wrong — A gets a surprise upgrade and keeps climbing while B stalls.

  • A runs to $112, B ticks to $101.50. The spread has widened to $112 − $101.50 = $10.50, or z = ($10.50 − $2.00) ÷ $0.50 = +17 — the relationship has clearly broken.
  • Mark-to-market: short A loses $112 − $104 = −$8; long B gains $101.50 − $101 = +$0.50. Net −$7.50 per share and still bleeding.
  • A stop at z = +3 (spread $3.50) would have closed the trade after only about $0.50 of adverse move per share, instead of $7.50.

This is the whole risk of pairs trading in one example: it is not arbitrage. When a real event decouples the two names, the spread can run against you indefinitely, which is exactly why a stop matters.

Common mistakes

  • Treating it as risk-free arbitrage. It's a bet that a statistical relationship holds — and relationships break.
  • Using correlation instead of cointegration. Two names can be highly correlated while their spread quietly drifts and never reverts.
  • Trading without a stop. Mean reversion has no built-in floor; a takeover bid or earnings shock can widen the spread without limit.
  • Not sizing the legs to the hedge ratio. Mismatched legs turn a market-neutral trade into a directional one you didn't mean to take.
  • Ignoring borrow and financing costs on the short leg, which quietly eat a thin convergence edge.

Frequently asked questions

Is pairs trading risk-free?
No. It removes most of the broad market's direction risk, but it replaces it with the risk that the two assets stop moving together. When a pair breaks — a merger, a bad earnings report, a sector shock — the spread can run against you with no natural stopping point.
Do the two assets have to be in the same sector?
Not strictly, but same-sector pairs (two airlines, two miners, two payment networks) share the drivers that make their spread mean-revert. The real requirement is a durable statistical link, not the label — same sector is just where you usually find it.
What's the difference between correlation and cointegration?
Correlation says two prices tend to move in the same direction day to day. Cointegration is stronger: it says the gap between them stays tethered to a stable level over time. Pairs trading needs the second — a high correlation with a drifting spread is a trap.
How do I size the two legs?
Match them so the position is market-neutral, using the hedge ratio: β units of B for every unit of A. At a hedge ratio of 1 that means one share (or unit) of B per share of A — the dollar amounts on each side only come out equal if the two prices happen to be similar. The pairs trading calculator handles the sizing.
Can I pairs-trade crypto?
Yes, the same spread-and-revert logic applies to two correlated tokens — but crypto links are less stable, moves are larger, and borrow to short can be costly or unavailable, so breaks are more frequent and more violent.

Related calculators

Methodology & limitations

The definitions and formulas on this page are standard, widely used ways to describe these concepts; every worked-example number is computed by hand from the formula shown so you can reproduce it. Where a rule varies by provider (prop-firm limits especially), we say so — treat the specifics as illustrative, not as any one firm's rulebook.

Not financial advice. This page explains a concept for education only. It is not investment, trading, or financial advice, and no example is a recommendation. Every prop firm writes its own rules and changes them — always verify against your own program, broker, or account terms before acting.

Last updated 2026-07-06.

Position Math · updated 2026-07-06 · all calculators
About · Affiliate disclosure · Risk disclosure · Contact · Privacy · Cookie · Disclaimer
Information tool only — not investment, trading, tax, or financial advice. All computation runs in your browser.