How to find cointegrated pairs without data-mining yourself into trouble
Finding pairs that look cointegrated is easy. Finding pairs that stay cointegrated after you have found them is the hard part. The difference comes down to how you search.
The multiple-testing trap
Take 500 stocks. That is about 125,000 possible pairs. At a 5% significance level, around 6,000 of them will pass a cointegration test even if none of them are truly related. Their spreads will look beautifully mean-reverting in the past and behave like random walks in the future. Every screening process has to defend against this.
Step 1: a small, sensible universe
Only pair assets that share a reason to move together:
- Same industry: two banks, two railroads, two soft-drink makers.
- Same underlying: two ETFs tracking the S&P 500, two gold ETFs, a miner ETF and a junior miner ETF.
- Same ecosystem in crypto: large-cap coins that trade against the same quote currency and react to the same flows.
Pairing only within groups cuts the number of tests by orders of magnitude. Arbitrading's universe of 98 instruments in 18 groups produces 276 candidate pairs instead of more than 4,700.
Step 2: run the tests on log prices
For each pair, regress log(A) on log(B) to get the hedge ratio, build the residual spread and test it with an Engle–Granger or ADF test. Use a formation window long enough to contain several cycles of the spread; a year of daily data (about 252 bars) is a common choice.
Step 3: correct for multiple testing
Instead of comparing each p-value with 0.05, control the false discovery rate. The Benjamini–Hochberg procedure turns p-values into q-values: a q-value of 0.05 means about 5% of the pairs you accept at that level are expected to be false discoveries. It is less strict than a Bonferroni correction and better suited to screening.
Step 4: filters that statistics alone miss
- Half-life between roughly 1 and 40 days. Too short is often noise or bid–ask bounce; too long ties up capital. See half-life of mean reversion.
- Positive hedge ratio. A negative β means you would be long or short both legs, which is a different bet.
- Hurst exponent below 0.5 as a second, independent sign of mean reversion.
- Liquidity and borrow. A pair you cannot short cheaply is not tradable, however good the statistics.
Step 5: check stability, not just significance
A pair that passes today but failed every month last year deserves less trust than one that passes consistently. Re-run the tests on rolling windows and look at how the p-value and hedge ratio evolve. A hedge ratio that swings from 0.5 to 1.5 is a warning sign even if the latest test passes.
Step 6: keep monitoring
Cointegration is a property of the past. Re-test regularly and treat a rising p-value on an open position as a reason to reassess. Correlation alone will not warn you; read cointegration vs correlation for why.
A shortcut
Arbitrading runs this whole process every day, after the US close for stocks and ETFs and hourly for crypto, and publishes the results for every pair on its pair statistics pages, for example KO vs PEP or GLD vs IAU. The statistics describe the past; they are not a recommendation to trade any pair.