Basic Prerequisites: Econometrics & Time Series (stationarity and unit roots). No prior trading knowledge needed.
1. Intuition & Practical Objective
This page builds the why of pairs trading with no prior knowledge needed. The objective is one idea: you do not need to know where the market is going; you only need two assets whose difference is pinned to a stable equilibrium, and the discipline to trade only deviations from it.
Start with the dumbest question: why would two stocks move together at all? Because they share the same nonstationary drivers - the market factor, their sector, commodity input costs, the rate level. If Chevron and ExxonMobil both load on the same “oil beta,” then a portfolio that is long one and short a scaled amount of the other has cancelled the oil exposure and holds only their idiosyncratic difference. Buy the cheap one, sell the expensive one, wait for the difference to close.
Three steps:
-
Prices are nonstationary; the right object is stationary. Individual prices wander (unit root, ). A single price has no “mean” to revert to, so trading a price is a bet on direction. But a linear combination can cancel the common random walk and leave a stationary residual that oscillates around a fixed level. That combination - the cointegrating vector - is the tradable object.
-
Correlation is about returns; cointegration is about levels. Two series can have return correlation and still diverge forever, because their difference is itself a random walk. Conversely a perfectly cointegrated pair can show modest month-to-month return correlation. Correlation says “they move together today”; cointegration says “they cannot drift apart permanently.” Only the second is tradable.
-
Market-neutrality is the product, not the goal. Because we trade the spread, the book carries no exposure to the market factor. The P&L is the idiosyncratic residual reverting - pure relative value. The risk is that the residual does not revert because the relationship changed.
2. Mathematical Ground Truth & Derivations
Stationarity, precisely. A series is (weakly) stationary if , , and all exist, are finite, and do not depend on . A random walk , , is the archetype of a nonstationary series: .
The common-trend model. Suppose two log-prices share one factor and differ only by stationary noise:
Then and are each , but
The spread is stationary even though neither price is. This is cointegration (Engle & Granger, 1987): are cointegrated if some makes . The vector is the cointegrating vector.
Why correlation misses this. The return correlation is determined by the innovations:
which tends to as the common factor dominates the noises - regardless of whether is stationary. Two independent random walks with correlated increments (a wholly artificial construction) have high return correlation and a spread -weighted random walk that diverges like . This is spurious co-movement and it is the single most common beginner disaster.
Variance-ratio signature. For a stationary spread, is bounded and its sample variance is flat as the window grows. For a random-walk spread, : the mean absolute deviation about the initial value grows like . The practical screen: plot, or test, whether the spread’s displacement grows without bound.
3. Computational Implementation - the trap, in numbers
We build two pairs with essentially the same return correlation and watch the spread behave completely differently. Stdlib only.
The correlations are indistinguishable ( vs ). Yet the cointegrated spread stays bounded (mean absolute spread ), while the spurious spread drifts away without limit ( and still growing like ). A trading rule that shorts deviations would keep adding to a losing position in the spurious case - there is no equilibrium to revert to.
4. Failure Modes & First-Principles Breakdowns
- “They’re correlated, so let’s pair them.” The beginner’s screen is - but that is a statement about the common innovation, not about the spread. You must test the level combination (Ch 2), not the returns.
- Spurious regression on levels. Regressing one price on another price gives a high and a “significant” -stat even when the series are independent (Granger & Newbold, 1974). The -distribution is nonstandard; the reported significance is an artifact. Any estimated this way must be validated by a unit-root test on the residual.
- Trading the price, not the spread. “Both should go up” is a directional bet. Pairs trading requires dollar-neutrality (long $1, short $β) so that the common factor - and the market’s direction - cancels. Without neutrality you have reintroduced exactly the risk you were trying to remove.
- Cointegration ≠ correct. Cointegration is a statistical property of a finite sample. A pair can pass the test by chance, and a genuine economic relationship can fail it in a short window. The test is a screen, not a proof (see 05 · Failure Modes).
5. References
- Tsay, Analysis of Financial Time Series
- Engle, R. F. & Granger, C. W. J., “Co-integration and Error Correction”, Econometrica 55(2), 1987
- Gatev, Goetzmann & Rouwenhorst, RFS 19(3), 2006
- Hasbrouck, Empirical Market Microstructure
6. Connected Graph Bridges
- Base: Econometrics & Time Series · Statistics & Inference
- Hub: Index Hub
- Continue: 02 · Cointegration & the Spread · 03 · Pairs Selection & Hedge
- Sibling: Cross-Sectional & Time-Series Momentum (the directional counterpart)