How to use Pair Trading Cointegration Tester
Paste two price series. The page runs the Engle-Granger cointegration test (OLS hedge ratio + ADF on residuals), estimates Ornstein-Uhlenbeck half-life, and plots z-score so you can tell whether the pair is mean-reverting on a tradeable timescale.
What It Does
Use the calculator with intent
Paste two price series. The page runs the Engle-Granger cointegration test (OLS hedge ratio + ADF on residuals), estimates Ornstein-Uhlenbeck half-life, and plots z-score so you can tell whether the pair is mean-reverting on a tradeable timescale.
Stat-arb developers screening candidate pairs who need a fast cointegration + half-life check before committing to a full backtest.
Interpreting Results
ADF p-value below 0.05 means residuals are stationary (the pair cointegrates). Half-life translates to your holding period — under 10 trading days is daily-strategy territory, 30+ days is monthly-strategy territory.
Input Steps
Field by field
- 1
Upload data
Upload two price series for the pair. The tester runs the Engle-Granger cointegration test first; failure → no test.
- 2
Set parameters
Set entry threshold (z-score for opening), exit threshold (z-score for closing), and stop-loss (z-score for kill-switch).
- 3
Set parameters
Set lookback window for the rolling z-score computation (default 60 days).
- 4
Run calculation
Run the backtest. Read realized Sharpe, max drawdown, trade count, and win rate.
- 5
Sweep inputs
Sweep entry threshold to see the trade-frequency-vs-Sharpe surface. Tighter thresholds = more trades, lower per-trade quality; looser = fewer trades, higher quality.
Common Scenarios
Use realistic starting points
Industry-pair candidate
Series A
Major bank A
Series B
Major bank B
Lookback
2 years daily
Sometimes cointegrated, sometimes not — the relationship breaks during earnings season and merger speculation. Out-of-sample test is essential.
ETF-pair candidate
Series A
SPY
Series B
VOO
Very tight cointegration (both track S&P 500), very short half-life, very small spread — capacity is the limit, not signal.
Try These Tools
Run the numbers next
Cointegration Half-Life Solver
Engle-Granger residual ADF + Ornstein-Uhlenbeck half-life from any two price/return series. Hedge ratio, p-value, spread chart. Browser-only.
Statistical Arbitrage Capacity Calculator
Maximum strategy AUM from signal half-life, daily volume, slippage, fees, and target Sharpe. Square-root impact closed-form.
FAQ
Questions people ask next
The short answers readers usually want after the first pass.
Related Content
Keep the topic connected
Overfitting
Overfitting in trading-strategy backtests: how multiple-testing inflates apparent edges and the diagnostics that catch it.
Look-Ahead Bias
Look-ahead bias: when a backtest accidentally uses data the strategy wouldn't have had at decision time. The most common variants and how to catch them.