Concept
Cointegration
Cointegration is a Statistics concept. The Library holds 1 implementations, each one a working definition you can pull into Quant.
Engle-Granger. Johansen
Top Cointegration indicators
1 total
What is Cointegration?
Cointegration is a long-run statistical tether between price series. Two or more series that each wander without a fixed mean are cointegrated when some linear combination of them is stationary: the weighted spread oscillates around a stable level even though the individual legs drift freely. The idea was formalized by Engle and Granger (1987). The Engle-Granger procedure tests it by regressing one leg on the other and checking the residual for stationarity; the Johansen test generalizes to several series at once and counts how many independent cointegrating relationships exist. It is distinct from correlation, which measures whether returns move together bar to bar, not whether levels stay anchored over months.
The concept matters because it is the statistical justification for spread and pairs trading: if the spread is stationary, deviations from its mean are expected, though never guaranteed, to be corrected, so the spread can be normalized (commonly z-scored) and faded at extremes with a hedge ratio taken from the cointegrating regression. The standing caveat is fragility: a relationship estimated in one window can weaken or break when fundamentals change, and a spread can keep widening far longer than a backtest suggests.
How traders use it
- Pairs selection and sizing: screen related instruments for cointegration, take the hedge ratio from the regression, and trade z-score extremes of the spread back toward its mean, the core of a pairs trading stack.
- Relationship monitoring: re-test the spread on rolling windows so positions are only taken while the equilibrium still appears intact, and stand down when the residual stops testing stationary.
- Hedging: constructing offsetting positions whose combined value tracks the stationary combination, reducing exposure to the common drift the legs share.
Cointegration vs related concepts
Correlation: Correlation measures whether returns move together over short horizons. Cointegration is about price levels sharing a long-run equilibrium: assets can be strongly correlated yet drift apart permanently, or weakly correlated yet tethered over long horizons. Spread trading rests on the tether, not the day-to-day echo.
Stationarity & Efficiency Tests: Stationarity tests interrogate a single series; cointegration asks whether a combination of non-stationary series becomes stationary. The Engle-Granger procedure literally ends in a stationarity test on the regression residual, which is why the two topics travel together.
Related concepts · Relationships
Concept family
Statistics
45 concepts mapped · 37 in the Library
Cointegration FAQ
What is the difference between correlation and cointegration?
Correlation says returns move together in the short run; cointegration says a combination of price levels keeps returning to a stable relationship in the long run. Two assets can correlate strongly for months while their prices drift apart for good, and a genuinely cointegrated pair can show weak daily correlation. Mean-reversion spread trades rest on cointegration, because only a stationary spread has a mean worth fading.
Do cointegrated pairs always revert to the mean?
No. Stationarity of the spread in the tested window implies a tendency to revert within that sample, not a contract. Relationships break when fundamentals diverge (index changes, business shifts, regime changes), the tests themselves have limited power, and even intact spreads can widen far beyond historical extremes before turning. Serious pairs workflows re-test the relationship on rolling windows and cap the loss per divergence.
Build Cointegration your way.
Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.
