Playground
Cointegration Half-Life Solver
Engle-Granger residual ADF + Ornstein-Uhlenbeck half-life from any two price/return series. Spread chart, hedge ratio, p-value.
- Inputs
- Paste + configure
- Runtime
- 1–15 s
- Privacy
- Client-side · no upload
- API key
- Not required
- Methodology
- Open →
Inputs
Half-life (days)
175.5
β = 1.426 · ADF p = 0.755 · no clear mean reversion
Cointegration diagnostics
Hedge ratio β
1.426
A = α + β·B + s
R²
0.147
OLS fit
ADF stat
-0.53
t-stat on Δs
AR(1) φ
0.996
<1 ⇒ reverting
Spread series
Reading the result
Half-life is the OU-process time to revert half-way to the spread mean. Pairs with half-life under 30 days are typical stat-arb candidates. ADF p-value < 0.05 lets you reject the unit-root null at 5%. See methodology.
How to use
Step-by-step
- 1
Upload two price series for the candidate pair. The tool will normalize and align timestamps.
- 2
Run the cointegration test (Engle-Granger ADF on residuals from the cointegrating regression). The tool refuses to estimate half-life if the test rejects.
- 3
If cointegration passes, the tool fits the OU mean-reversion process and reports half-life with standard error.
- 4
Compare half-life across rolling windows (1-year, 3-year, full sample). Stable half-life across windows = robust pair; unstable = the relationship is regime-dependent.
- 5
If half-life is under 30 days and cointegration is stable, the pair is a candidate for further backtesting. Above 90 days, alpha decays before transaction costs amortize.
Glossary references
Terms used by this tool
Questions people ask next
FAQ
What's cointegration half-life?
How long it takes for half of a cointegrated spread's deviation from equilibrium to mean-revert. From the Ornstein-Uhlenbeck speed-of-mean-reversion parameter θ: half-life = ln(2) / θ. Pairs with half-life under 30 days are typically tradeable; above 90 days, the alpha decays before round-trip costs are recovered.
How is θ estimated?
Linear regression of Δspread_t on spread_(t-1). The regression slope is -θ. The methodology page documents the OLS form and the standard error, plus a check on residual autocorrelation (Ljung-Box) — if residuals aren't white, the OU model is mis-specified and the half-life estimate is unreliable.
Does the tool test for cointegration first?
Yes — Engle-Granger two-step test (ADF on the residuals from the cointegrating regression) and Johansen test for the rank of the cointegrating relationship. The tool refuses to compute half-life if the test rejects cointegration; the methodology explains why a half-life on a non-cointegrated series is meaningless.
How sensitive is half-life to lookback length?
Highly. Estimating from 6 months gives a different number than 5 years. The tool computes half-life across rolling 1-year, 3-year, and full-sample windows and flags pairs where the estimate is unstable across windows. Stability matters more than the absolute number.
Can I use this for cross-asset pairs?
The math doesn't care about asset class — it works for stock pairs, ETF arbitrage, crypto pairs, FX pairs. But the cointegration premise (a stable long-run equilibrium) is most credible for assets with structural linkage: dual-listed shares, ETF-vs-creation-basket, futures-vs-cash. Speculative pair trades on non-linked assets often produce false-positive cointegration tests.
Related deep dive
All articles →Read further
Long-form context behind the tool output.
- Tutorial · Runnable·7 min
Signal Orthogonality: Why Ensembles Become One Bet
A 10-signal ensemble with pairwise correlation 0.8 is effectively a 1.5-signal ensemble. The math, a two-minute diagnostic, and three axes that work.
Read - Methodology · Opinion·11 min
Multi-Timeframe Signal Integration With LLMs
LLMs belong on weekly fundamentals, not intraday microstructure. A two-layer architecture: weekly LLM thesis plus rule-based intraday invalidation gates.
Read
Complementary tools
Users of this tool often explore
Pair Trading Cointegration Tester
Paste two price series. Engle-Granger cointegration test: OLS hedge ratio, Augmented Dickey-Fuller on residuals, Ornstein-Uhlenbeck half-life, z-score.
Statistical Arbitrage Capacity Calculator
Maximum strategy AUM from signal half-life, daily volume, slippage, fees, and target Sharpe. Square-root impact closed-form.
Correlation Matrix Visualizer
Paste a multi-asset returns CSV. See the Pearson correlation heatmap, condition number, average absolute correlation, and eigenvalue concentration.