Direct Answer
Cointegration for pairs trading refers to a statistical property where two assets' prices, each individually unpredictable and non-stationary, combine in a specific ratio to form a spread that is stationary, meaning it fluctuates around a stable long-run mean instead of drifting indefinitely. Traders test for cointegration to find pairs whose spread is statistically likely to revert, then trade that reversion by going long the relatively cheap asset and short the relatively expensive one. Cointegration is a stronger requirement than simple correlation and is typically confirmed with a regression plus a stationarity test such as the Augmented Dickey-Fuller (ADF) test.
Key Takeaways
- Cointegration means a specific linear combination of two non-stationary price series is itself stationary and mean-reverting.
- It is the statistical foundation of classical pairs trading and statistical arbitrage strategies.
- Cointegration is stronger than correlation, correlated prices can still drift apart permanently; cointegrated spreads are expected to revert.
- The standard test is the Engle-Granger two-step method: estimate a hedge ratio by regression, then run an ADF test on the resulting spread.
- The hedge ratio determines position sizing between the two legs so the combined trade tracks the stationary spread.
- A cointegrated relationship is estimated from historical data and can break down due to mergers, sector shifts, or regulatory change.
- Traders typically enter when the spread deviates significantly from its historical mean and exit as it reverts.
- Cointegration testing is most often applied to economically related pairs, such as companies in the same sector or closely linked securities.
What Is Cointegration?
Most individual asset prices are non-stationary, they wander over time without reverting to a fixed mean, which is why raw price levels are hard to trade based on "it always comes back." Cointegration describes a special case: even though two price series individually wander, a specific weighted combination of them stays anchored around a stable long-run average. That combination is called the spread, and its tendency to revert to its mean is what pairs traders try to exploit.
Formally, two price series X and Y are cointegrated if there exists a coefficient β (the hedge ratio) such that the spread
Spread = Y − β × X
is stationary, even though X and Y individually are not. The coefficient β is typically estimated by regressing Y on X; the residuals from that regression form the candidate spread, which is then tested for stationarity, most commonly with the Augmented Dickey-Fuller (ADF) test. A sufficiently negative ADF test statistic relative to its critical value is taken as evidence the spread is stationary, supporting a conclusion of cointegration.
Worked Example (Hypothetical)
Consider a hypothetical scenario involving two fictional companies, "Stock A" and "Stock B," in the same industry. Suppose a trader regresses Stock B's price on Stock A's price over a hypothetical lookback period and estimates a hedge ratio of β = 1.20, meaning Stock B has historically tracked roughly 1.20 times Stock A's price moves. The resulting hypothetical spread, calculated each day as Stock B minus 1.20 times Stock A, has averaged around $2.00 over that period with a standard deviation of $0.50.
If an ADF test on that hypothetical spread rejects the null hypothesis of a unit root. The trader treats the pair as cointegrated. Suppose the spread then widens to $3.50, roughly three standard deviations above its historical mean. A trader following this hypothetical, illustrative approach might short Stock B and buy 1.20 shares of Stock A (per share of Stock B shorted), betting the spread narrows back toward its $2.00 average. If the spread reverts to $2.00, the position could be closed for a hypothetical profit; if the spread continues widening instead, the trade would lose money, illustrating that cointegration is a historical statistical estimate, not a guarantee.
Why Cointegration Matters
Pairs trading and broader statistical arbitrage strategies depend on finding relationships that are more predictable than either individual asset's price. Trading raw correlation is unreliable because two assets can move together for a while and then permanently diverge with no tendency to come back. Cointegration testing gives traders a more rigorous filter: it looks specifically for a combination of prices with a demonstrated statistical tendency to revert, which is the property a mean-reversion strategy actually needs.
Because the hedge ratio is derived directly from the cointegrating regression, it also gives traders a principled way to size each leg of the trade so that the combined position reflects the spread's behavior rather than simply being exposed to the broader market direction of either asset. This is part of why cointegration-based pairs trading is often discussed as a relatively market-neutral approach, at least with respect to the two names in the pair.
Limitations and Common Mistakes
- Treating cointegration as permanent. A cointegrated relationship is estimated over a historical sample and can break down going forward due to mergers, sector shifts, management changes, or regulatory events.
- Confusing correlation with cointegration. Two assets can be highly correlated in returns yet not cointegrated in price levels, and vice versa, they are different statistical properties measuring different things.
- Data mining / spurious relationships. Testing many pairs and only reporting the ones that pass a cointegration test increases the risk of finding relationships that appear statistically significant by chance.
- Ignoring transaction costs and borrow costs. A statistically valid but small mean-reverting spread can be unprofitable once trading costs, slippage, and short-borrow fees are included.
- Using a static hedge ratio indefinitely. The estimated β can drift over time; traders who never re-estimate it risk mismatched position sizing relative to the current relationship.
- Overlooking regime risk. A spread widening sharply may reflect a genuine breakdown in the relationship (regime change) rather than a temporary deviation likely to revert, treating every wide spread as an entry signal ignores this risk.
When the Relationship Ends for a Reason No Test Can See
An ADF test tells you the spread has behaved in a mean-reverting way over the sample. It cannot tell you that one of the two companies is about to be acquired, spun off, reclassified into a different sector or subjected to a rule change that alters its economics. Those events end a cointegrated relationship outright, and they arrive without any deterioration in the statistics beforehand. The break shows up in the position before it shows up in the p-value.
That argues for knowing why the pair should be related before trading it. A relationship with a plausible economic story, two firms exposed to the same input costs or the same demand cycle, gives you something to monitor other than the spread itself. A pair found purely by screening has no such handle, and it is also the kind most likely to have passed the test by chance.
Which is the second discipline: count the pairs you tested. Running a cointegration test across hundreds of candidates and reporting the ones that passed is a multiple-comparisons problem, and some of those passes are noise regardless of how convincing the individual result looks.
Two practical items. The hedge ratio is estimated from the same historical window and can drift, so a static ratio applied for months may no longer describe the combination that was stationary. And a statistically valid spread can be economically dead: once spread, slippage and short-borrow costs are subtracted, a small reversion is not a trade.
Frequently Asked Questions
What is cointegration in pairs trading?
Cointegration is a statistical property describing two (or more) non-stationary price series that move independently over time but whose specific linear combination, the spread, remains stationary, meaning it tends to revert to a stable mean. In pairs trading, cointegration is the basis for identifying two assets whose price relationship is expected to hold over time even though each individual price wanders.
How is cointegration different from correlation?
Correlation measures whether two series move together over a given window, but two correlated series can drift apart permanently with no tendency to revert. Cointegration is a stronger, longer-run property: it implies a specific combination of the two prices stays anchored around a stable mean over time, which is what makes the spread tradeable as a mean-reversion setup.
How do traders test for cointegration?
The most common approach is the Engle-Granger two-step method: regress one price series on the other to estimate the hedge ratio, compute the resulting residual spread, then run an Augmented Dickey-Fuller (ADF) test on that spread to check whether it is stationary. A sufficiently negative ADF test statistic (below the relevant critical value) is taken as evidence the spread is stationary and the pair is cointegrated.
Can a cointegrated relationship break down?
Yes. Cointegration is estimated from historical data and is not guaranteed to persist. A merger, a change in sector fundamentals, a regulatory event, or a structural shift in either underlying business can permanently break the statistical relationship, causing the spread to trend rather than revert, a key risk in pairs trading known as regime change.
What is the hedge ratio in a cointegrated pair?
The hedge ratio is the coefficient from the regression of one asset's price on the other; it determines how many units of the second asset to hold against one unit of the first so that the combined position forms the stationary spread. It sizes the pairs trade so gains or losses reflect the spread's behavior rather than the market-wide direction of either asset.
What is the spread in a cointegrated pair?
The spread is the linear combination of the two price series whose residual the test found to be stationary: one leg minus the hedge ratio multiplied by the other. It is the quantity actually traded, not either price on its own. Because the hedge ratio is estimated rather than known, the spread is only as stable as that estimate, and re-estimating it on new data produces a different series.
Why are cointegration tests usually run on log prices?
Because differences of log prices are returns, so a relationship expressed in logs is a relationship between proportional moves rather than absolute ones. Two assets that maintain a stable price ratio will show a stationary log spread even as both drift higher, where a spread in raw currency terms would widen with the level. The log form also keeps the hedge ratio interpretable across a long history.
How does the estimation window length affect a cointegration test?
A longer window gives the test more power to detect a genuine relationship, but it also assumes the relationship held across the whole period, which becomes less plausible the further back it reaches. A short window has the opposite problem: with few observations, unrelated series can pass the test by chance. Neither choice is neutral, and a pair that is cointegrated on one window frequently is not on another.
What is the multiple-testing problem when screening for cointegrated pairs?
The number of candidate pairs grows roughly with the square of the number of assets, so a universe of a few hundred names produces tens of thousands of tests. At any conventional significance level a fixed proportion of unrelated pairs will pass by chance, and with that many tests the expected count of false passes is large. A screen that reports its best pairs without adjusting for how many it examined is reporting the tail of a random distribution.
References
Disclaimer
This page is for educational purposes only and does not constitute investment, financial, or trading advice. The worked example on this page uses hypothetical, illustrative figures, not live or historical market data. Statistical relationships like cointegration are estimated from historical prices and can break down without warning; they do not guarantee future results. Swoopr Investment is not a licensed investment advisor; consult a qualified professional before making investment decisions.