On this page
Cointegration Pairs Trading: Trade Mean-Reverting Spreads
Cointegration pairs trading goes long one asset and short another in a ratio such that the combined spread is stationary, even though each asset alone is a random walk. The trade profits when the spread deviates from its long-run equilibrium and then reverts.
Key Takeaways
- Cointegration pairs trading requires that a linear combination of two individually non-stationary assets is stationary; the Engle-Granger two-step procedure estimates the hedge ratio and tests the spread for a unit root.
- A KO-PEP pair with beta of 0.85 passed the ADF unit-root test at the 5 percent level on 2015–2024 data, producing four to six complete round trips per year with typical hold times of 10 to 30 days.
- The biggest practical mistake is using a static OLS beta when the true ratio drifts; a Kalman filter or rolling regression should reestimate beta continuously rather than fixing it once at the start.
- Cointegration is a hypothesis subject to rejection, not a permanent fact; a spinoff, merger, or fundamental shift can break the relationship and leave the spread trending against the trader indefinitely.
Key Takeaways
- Cointegration pairs trading requires that a linear combination of two individually non-stationary assets is stationary; the Engle-Granger two-step procedure estimates the hedge ratio and tests the spread for a unit root.
- A KO-PEP pair with beta of 0.85 passed the ADF unit-root test at the 5 percent level on 2015–2024 data, producing four to six complete round trips per year with typical hold times of 10 to 30 days.
- The biggest practical mistake is using a static OLS beta when the true ratio drifts; a Kalman filter or rolling regression should reestimate beta continuously rather than fixing it once at the start.
- Cointegration is a hypothesis subject to rejection, not a permanent fact; a spinoff, merger, or fundamental shift can break the relationship and leave the spread trending against the trader indefinitely.
What It Is
Two non-stationary series X_t and Y_t are cointegrated if there exists a constant beta such that the linear combination Y_t - beta * X_t is stationary. Engle and Granger introduced the concept in 1987 and showed that cointegrated variables admit an error-correction representation. For a cointegration pairs trading strategy, you estimate beta, form the spread, and trade deviations from its mean.
The canonical example is two stocks in the same industry that share the same underlying drivers. Their prices wander individually but the spread between them stays within a range.
The Intuition
Correlation is about co-movement of returns over short windows. It tells you nothing about whether prices drift apart permanently. Cointegration is about levels. It says that although each series has a unit root, a specific linear combination does not, which is a much stronger statement and the one that matters for a spread trade.
If you build a pair on correlation alone, you can hold a spread that trends against you forever. If you build it on cointegration that still holds out of sample, reversion to the spread mean is statistically expected.
How It Works
The Engle-Granger two-step procedure is the textbook starting point:
Step 1: Estimate the cointegrating coefficient beta by OLS:
Y_t = alpha + beta * X_t + e_t
Step 2: Test whether the residual e_t is stationary using the augmented Dickey-Fuller (ADF) test. If the null of a unit root in e_t is rejected, X_t and Y_t are cointegrated.
The tradeable spread is:
spread_t = Y_t - beta * X_t
Form a z-score relative to the spread's own mean and standard deviation:
z_t = (spread_t - mean(spread)) / stdev(spread)
A common rule goes long the spread (buy Y, short beta units of X) when z_t < -2 and closes at z_t > -0.5. Symmetrically short the spread at z_t > +2.
Worked Example
Consider Coca-Cola (KO) and Pepsi (PEP) daily closing prices from 2015 to 2024. A log-log regression estimates beta approximately 0.85. ADF on the residual gives a test statistic of -3.6 with a 5 percent critical value of -3.0, so you reject the unit-root null at 5 percent.
The residual has mean approximately 0 and standard deviation approximately 0.04. On a day when the residual hits -0.085 (z = -2.1), you go long 1 share of PEP and short 0.85 shares of KO per share of PEP. You exit when the residual returns to -0.02 (z = -0.5). The P&L is the convergence of the spread minus financing and borrow costs. Over the test window, the pair offers roughly four to six complete round trips per year with typical hold times of 10 to 30 trading days.
Common Mistakes
-
Forgetting that cointegration is a hypothesis, not a fact. Rejecting the unit-root null at 5 percent means there is still a 5 percent chance the spread is actually non-stationary. Out-of-sample the relationship can break entirely after an earnings event, spinoff, or structural change in the business.
-
Using fixed hedge ratios when beta drifts. A static OLS beta fit once on five years of data ignores that the true ratio wanders. Practitioners often use a Kalman filter or rolling regression to re-estimate beta and rebuild the spread continuously.
-
Ignoring transaction costs and borrow fees. The short leg carries a borrow cost that can easily exceed the expected spread return. Hard-to-borrow names in the pair can turn a theoretically profitable trade into a certain loser.
-
Data mining pairs without correction for multiple testing. If you scan 10,000 pairs and keep the ones with the strongest ADF rejection, some will pass by chance. Holdout testing and a stricter alpha (1 percent or lower) help, and so does economic reasoning about why the pair should co-move.
-
Confusing Engle-Granger with Johansen. Engle-Granger assumes one cointegrating relationship and depends on which variable you put on the left. Johansen handles N variables and K cointegrating vectors and does not privilege any ordering. For baskets of three or more names, Johansen is the right tool.
Frequently Asked Questions
Q: What is cointegration pairs trading in simple terms? It is a market-neutral strategy that buys one asset and sells another in a fixed ratio such that the combined position forms a stationary spread. Because the spread reverts to a long-run mean, you profit when it widens and close when it contracts, regardless of which direction the individual assets move.
Q: How does cointegration affect investment decisions? It provides a statistical basis for spread trades that goes beyond correlation. Correlation measures whether two assets move together over short windows; cointegration tests whether their prices share a long-run equilibrium. Only cointegration guarantees that extreme spread deviations will eventually reverse, which is the assumption the trade depends on.
Q: What is a real-world example of a cointegration pairs trade? KO and PEP with an estimated hedge ratio of 0.85 passes the ADF test at 5 percent significance on data from 2015 to 2024. When the residual drops to a z-score of minus 2.1, the trader goes long 1 share of PEP and short 0.85 shares of KO. The position is closed when the z-score returns to minus 0.5, capturing the spread convergence net of borrow costs.
Q: How can investors protect themselves when the cointegrating relationship breaks down? Monitor the spread's behavior in real time using rolling ADF tests or the Kalman filter's innovation variance. If the spread consistently trends rather than mean-reverting, or if a corporate event like a merger or spinoff affects one leg, exit the trade immediately and re-test cointegration before re-entering.
Q: How is cointegration different from correlation? Correlation measures the strength of co-movement in returns over a short horizon. Cointegration is a property of price levels over long horizons, it means the two assets share a common stochastic trend and cannot drift apart permanently. A pair with 0.9 correlation but no cointegration can still diverge by a large amount that never reverts, making it dangerous to trade as a spread.
Sources
- Engle, R.F. and Granger, C.W.J. (1987). "Co-integration and Error Correction: Representation, Estimation, and Testing." Econometrica 55(2), 251-276. https://users.ssc.wisc.edu/~behansen/718/EngleGranger1987.pdf
- Vidyamurthy, G. (2004). Pairs Trading: Quantitative Methods and Analysis. Wiley. https://www.wiley.com/en-us/Pairs+Trading%3A+Quantitative+Methods+and+Analysis-p-9780471460671
- Gatev, E., Goetzmann, W.N., Rouwenhorst, K.G. (2006). "Pairs Trading: Performance of a Relative-Value Arbitrage Rule." Review of Financial Studies 19(3), 797-827. https://www.nber.org/papers/w7032
- Econometric Society. "Co-integration and Error Correction." https://www.econometricsociety.org/publications/econometrica/1987/03/01/co-integration-and-error-correction-representation-estimation
Disclaimer
This article is educational content only and is not financial advice. Nothing here is a recommendation to buy, sell, or hold any security. Consult a licensed advisor before making investment decisions.