Find statistically robust pairs for mean-reversion trading using cointegration analysis
Scanning pairs for cointegration...
Pairs Tested
0
Cointegrated
0
With Signal
0
Best Opportunity
-
Pair
p-value
Hedge Ratio
Half-Life
Z-Score
Signal
Spread %
Analyzing cointegration...
ADF Statistic
-
p-value
-
Lower = more cointegrated
Hedge Ratio (β)
-
Half-Life
-
Mean reversion speed
Current Z-Score
-
Correlation
-
Price correlation
Normalized Prices (rebased to 100)
Spread (A - β × B)
Z-Score with Signal Bands
Spread Distribution
📋 Trade Setup
What is Cointegration?
Cointegration identifies pairs that share a long-run equilibrium. Unlike correlation (which measures co-movement), cointegration means the spread between two assets is mean-reverting — when it deviates, it tends to return to the mean.
Why it matters: Two assets can be highly correlated but NOT cointegrated (they drift apart over time). Cointegrated pairs are statistically proven to revert, making them ideal for pairs trading.
Engle-Granger Method
We use the Engle-Granger two-step approach:
Step 1: Estimate hedge ratio (β) via OLS regression: A = α + β × B + ε
Step 2: Test residuals (spread) for stationarity using ADF test
If the spread is stationary (ADF p-value < 0.05), the pair is cointegrated.
Key Metrics
p-value: Probability spread is NOT stationary. Lower = stronger cointegration.
Hedge Ratio (β): For every 1 unit of A, trade β units of B in opposite direction.
Half-Life: Expected time for spread to revert 50% toward mean. Shorter = faster mean reversion.
Z-Score: Current spread in standard deviations from mean. |Z| > 2 = potential signal.
Trading Signals
Z-Score < -2: Spread is oversold → Long A, Short B (expect spread to widen)
Z-Score > +2: Spread is overbought → Short A, Long B (expect spread to narrow)
Exit: When Z-Score returns to 0 (mean reversion complete)
Stop-Loss: If |Z-Score| > 3-4 and continuing to diverge
Best Practices
Only trade cointegrated pairs (p-value < 0.05)
Prefer half-life between 12-72 hours (fast enough to trade, not noise)
Use rolling cointegration tests — relationships can break down
Consider transaction costs — spread must be wide enough to profit after fees
Size positions to match hedge ratio exactly for market-neutral exposure