Position Math

Calculators › Trading

Pairs Trading Calculator

Find the hedge ratio that makes two legs dollar-neutral, read the spread z-score to time entries and exits, and split capital across both legs — backed by a live cointegration scanner that ranks how every instrument pairs with the one you want to trade.

Live pair scanner — pick one instrument, see every pairing

Other legAnchor legOther leg size Not $zcorrHalf-lifeRiskRelationship
Press “Scan” to pull live data…
spread = ln(anchor) − β·ln(other) − intercept · z = (spread − 120-day mean) ÷ 120-day std · entry ✅2.0σ ⚠️2.2σ ❌2.5σ, exit ±0.5σ
Manual tools — type the numbers, computed in your browser

No connection needed. Use these to learn the math behind the scanner, or to size a pair when you already have your own β and spread statistics.

1 · Hedge ratio & spread

Short shares of B (β-$-neutral)
Notional A / Notional B
Net $ exposure
Price spread A − β·B
Dollar-neutral means each leg carries the same $ notional (β scales how much B you short per $ of A).

2 · Spread z-score & signal

z-score
How extreme
Enter when |z| crosses the threshold; flatten when it falls back inside ±0.5σ.

3 · Two-leg position split

Leg A — long
Leg A notional
Leg B — short
Leg B notional
Splits gross capital so the two legs sit at the β notional ratio (β=1 → equal $, market-neutral).

How it works

What this page does

Pairs trading bets that two related instruments, which usually move together, will snap back toward their normal relationship after they drift apart. You go long one leg and short the other, so broad market direction roughly cancels and you trade the spread between them. This page has a live scanner plus three manual calculators.

The live scanner

Pick an anchor — the instrument you actually want to trade — and how many lots or shares you intend to put on it. The scanner pulls daily prices for a basket of major FX pairs, metals, energy, indices, big tech stocks and BTC, then for each pairing it estimates the hedge ratio, the spread, its z-score, the rolling correlation, the mean-reversion half-life, and the size for the other leg. Every row carries an honest relationship badge:

  • ✅ real pair — cointegration confirmed and the half-life is in a tradeable band, so the spread has historically mean-reverted (there is an edge to trade).
  • ⚠️ weak — the two are correlated but cointegration did not pass or the spread reverts too slowly; size small and lean on discipline.
  • ❌ none — correlation is too weak; the numbers only balance the legs mechanically, there is no spread edge to harvest.

Zero ✅ rows is normal — genuine cointegration is rare and fragile. The scanner reads delayed Yahoo daily data cached on our server (refreshed hourly); it is research, not a trade signal, and connects to no account.

1 · Hedge ratio & spread

The hedge ratio β sets how much of leg B you short per dollar of leg A. With β = 1 the two legs carry equal dollar notional — dollar-neutral. Short shares of B come from β × (shares_A × price_A) / price_B, and the price spread shown is A − β·B. The scanner's spread is the log version, ln(A) − β·ln(B) − intercept, fitted by an Engle–Granger cointegration regression.

2 · Spread z-score & signal

The z-score says how far today's spread sits from its recent average, in standard deviations: z = (spread − mean) / std. The bigger the absolute value, the more stretched the pair. A common rule enters when |z| crosses a threshold (2.0σ for the cleanest pairs, higher for weaker ones) and flattens once it falls back inside ±0.5σ. A positive z means the spread is rich (short it); negative means cheap (long it).

3 · Two-leg position split

Given the capital you want deployed gross, it splits across the two legs at the β notional ratio: A notional = capital / (1 + β) and B notional = capital × β / (1 + β), then converts each to a share or lot count at the prices you enter. At β = 1 the split is even and market-neutral.

What it deliberately does not do

It will not promise the spread reverts — cointegration breaks, especially around earnings or regime shifts, and after costs the edge in pairs trading is thin. Lot and contract sizes are estimates; the robust outputs are the ratio and the spread statistics, not a share count down to the decimal. This is an information tool for education, not investment advice.

Frequently asked questions

What is a pairs trading calculator?
It works out the three numbers a pairs trade needs: the hedge ratio that makes the two legs dollar-neutral, the spread z-score that tells you how stretched the pair is right now, and how to split capital across both legs. This page also runs a live cointegration scanner that ranks how every instrument pairs with the one you choose.
How do I calculate the hedge ratio for a pair?
The hedge ratio β scales the short leg to the long leg. For a dollar-neutral hedge, short shares of B = β × (shares_A × price_A) / price_B; with β = 1 each leg carries the same dollar notional. The live scanner estimates β statistically from an Engle–Granger cointegration regression on the two price series.
What spread z-score should I enter a pairs trade at?
A widely used rule enters when the absolute z-score crosses about 2σ and exits when it falls back inside ±0.5σ. Cleaner, cointegrated pairs can use 2.0σ; weaker relationships need a more extreme reading (2.2–2.5σ) before they are worth the cost. A positive z means short the spread, negative means long it.
What does the cointegration badge mean?
✅ means the pair passed a cointegration test and reverts within a tradeable half-life — there is a spread edge. ⚠️ means they are only correlated, not cointegrated, so trade small. ❌ means correlation is too weak and the position is just a mechanical hedge with no edge. High correlation alone does not make a tradeable pair; the spread also has to mean-revert.
Is the live scanner real-time?
No. It uses delayed end-of-day (daily) data from Yahoo, cached on our server and refreshed hourly, which is enough to judge a pair's structure before the session. It is for research, not execution — your actual fills and contract specs come from your own broker or prop firm.
Does this calculator give trading advice?
No. Everything here is an estimate from public data or the numbers you type. Pairs trading carries real risk — cointegration can break and both legs can lose at once. Verify sizes on your own platform and treat the output as education, not investment, trading, tax, or financial advice.

Related calculators

Information tool only. The manual tools are deterministic arithmetic from the numbers you enter. The live scanner reads delayed Yahoo daily data (cached server-side, refreshed hourly) and runs a cointegration estimate — it is for research, not a trade signal, and connects to no account and stores nothing about you. Lot/contract sizes are estimates; verify on your own broker or prop firm before acting.
Disclosure. Some outbound links may be affiliate or partner links; they never change how a tool computes.
Position Math · updated 2026-06-27 · all calculators
Information tool only — not investment, trading, tax, or financial advice. All computation runs in your browser.