Free Article

Cointegration Explained: The Strategy Institutional Traders Use

Updated July 2026 · 12 min read · Intermediate

If you have ever noticed that BP and Shell tend to move together over time, or that Lloyds and Barclays seem pulled by the same invisible force, you have intuited one of the most powerful concepts in quantitative finance: cointegration.

Cointegration is the statistical backbone of pairs trading — a market-neutral strategy used by hedge funds, proprietary trading desks, and quantitative investment managers around the world. Unlike directional trading (which bets that a stock goes up or down), pairs trading bets that the relationship between two stocks will revert to its historical norm.

This guide explains cointegration from first principles: what it is, how it differs from the more familiar concept of correlation, how to test for it statistically, and how to use Fintiq's Pairs tab to find cointegrated pairs on the London Stock Exchange and build trading signals from them.

Correlation vs Cointegration: A Critical Distinction

Most investors are comfortable with the concept of correlation: a measure of how closely two price series move together at the same time. A correlation of +1.0 means they move in perfect lockstep. A correlation of 0 means they move independently. A correlation of -1.0 means they move in exactly opposite directions.

Correlation is useful, but it has a fundamental weakness: it measures synchronised movement at a point in time, but it says nothing about the long-run relationship between two series. Two stocks can have a high correlation over a short period that then completely breaks down. They can trend together for a year, diverge for two years, and reconverge. Correlation captures snapshots; it does not capture structural relationships.

Cointegration is fundamentally different. Two price series are cointegrated if they share a long-run equilibrium relationship — a common stochastic trend — such that even though they can diverge in the short run, they are always pulled back toward each other over time. The divergences are temporary; the relationship is structural.

The dog on a lead analogy: Imagine a drunk person walking a dog. The person wanders left and right unpredictably. The dog also wanders, following its own nose. At any given moment, the person and dog might be far apart. But the lead constrains them: they cannot diverge beyond a certain distance before the lead pulls them back together. Cointegration is the "lead" — the long-run economic constraint that prevents two related stocks from diverging permanently.

Why Does Cointegration Exist Between Stocks?

Cointegration is not a statistical artifact — it has a genuine economic explanation. Two stocks are cointegrated when they are exposed to the same long-run economic forces. The most natural examples are companies in the same sector exposed to the same commodity prices, regulatory environment, and investor base.

BP and Shell

Both are integrated oil majors listed on the LSE. Their revenues are primarily driven by the global price of crude oil and natural gas. Their costs are driven by similar exploration and production factors. Both are subject to UK and EU energy regulation, and both attract the same type of institutional investor (energy sector funds, ESG-screened mandates, income-seeking funds). When BP's stock falls relative to Shell without any BP-specific fundamental reason, rational investors notice the divergence and buy BP while selling Shell — capital flows that pull the relationship back toward equilibrium.

Lloyds and Barclays

Both are major UK retail and commercial banks. Their net interest income is driven by the Bank of England base rate. Their credit losses are driven by UK mortgage defaults, consumer credit quality, and business lending health. Both operate under PRA and FCA regulation. When Lloyds cheapens relative to Barclays — with no bank-specific fundamental justification — value investors and relative-value hedge funds step in to close the gap.

Other Classic LSE Pairs

PairSectorCommon Economic Driver
Rio Tinto / BHPMiningIron ore price, global steel demand, Chinese infrastructure
Vodafone / BTUK TelecomsUK broadband/mobile regulation, infrastructure capex
Tesco / Sainsbury'sUK GroceriesUK consumer spending, food inflation, competitive dynamics
Diageo / Pernod RicardSpiritsPremium spirits demand, EM consumer growth, pricing power

The Engle-Granger Test for Cointegration

Clive Granger won the Nobel Prize in Economics in 2003 for his work on cointegration (shared with Robert Engle). The most widely used test for cointegration is the Engle-Granger two-step procedure:

Step 1: Run the Cointegrating Regression

Regress the price of Stock A on the price of Stock B over a historical window (typically 2-5 years of daily price data):

Price_A = alpha + beta * Price_B + residuals Where: alpha = intercept (constant offset) beta = the hedge ratio (how many shares of B to short per share of A) residuals = the spread series — the difference between actual and predicted prices

The residuals represent the "spread" between the two stocks — the deviation of their relationship from the long-run equilibrium defined by the regression. If the pair is cointegrated, this spread series will be stationary (mean-reverting). If they are not cointegrated, the spread will wander without bound.

Step 2: Test the Residuals for Stationarity

Run an Augmented Dickey-Fuller (ADF) test on the residuals. The ADF test checks whether a time series has a unit root (i.e., whether it is non-stationary and wanders without bound) or is stationary (mean-reverting).

ADF Test Decision Rule: p-value < 0.05: Reject the null hypothesis of a unit root → Spread is STATIONARY → Pair IS cointegrated p-value >= 0.05: Fail to reject the null hypothesis → Spread may be non-stationary → Pair is NOT cointegrated Confidence levels: p < 0.01: Very strong evidence of cointegration (1% significance) p < 0.05: Strong evidence (5% significance) — standard threshold p < 0.10: Weak evidence (10% significance) — proceed with caution

Fintiq's Pairs tab runs this test automatically when you enter two tickers, displaying the ADF p-value prominently so you can immediately assess whether the pair has statistically significant evidence of cointegration.

The Trading Signal: Z-Score Based Entry and Exit

Once you have confirmed that a pair is cointegrated and the spread is stationary, you can build a trading signal from the spread's Z-score. The Z-score measures how many standard deviations the current spread is from its historical mean:

Z-Score = (Current Spread - Mean Spread) / Standard Deviation of Spread Trading signals: Z > +2.0: Spread is unusually WIDE (Stock A expensive vs Stock B) Action: SELL Stock A, BUY Stock B Expectation: spread will narrow back toward the mean Z < -2.0: Spread is unusually NARROW (Stock A cheap vs Stock B) Action: BUY Stock A, SELL Stock B Expectation: spread will widen back toward the mean |Z| < 0.5: Spread near mean — close positions and take profit

The beauty of this strategy is that it is market-neutral: you are simultaneously long one stock and short the other, so the position has minimal exposure to broad market movements. If the entire market falls 10%, both your long and your short position decline, and the P&L impact roughly cancels out (assuming the pair maintains its relationship). Your profits come purely from the spread reverting to its mean.

A Worked Example: BP vs Shell

Suppose the historical mean spread between BP and Shell (after applying the hedge ratio from the cointegrating regression) is 0, with a standard deviation of 0.8 units.

Today, BP has fallen sharply due to a minor operational incident at a single refinery, while Shell has been unaffected. The spread widens to +2.4 units. This gives a Z-score of (2.4 - 0) / 0.8 = +3.0.

At Z = +3.0, you sell BP (the expensive stock relative to Shell) and buy Shell (the cheap stock relative to BP). Your thesis: the operational incident is temporary and specific to BP; the long-run relationship between two oil majors driven by the same crude oil price will reassert itself. Over the next two to four weeks, the spread reverts to 0. Your short BP position profits as BP recovers, and your long Shell position profits as Shell maintains its value. Z-score returns to near 0. You close the position and take your profit.

Risks of Cointegration-Based Trading

Cointegration trading is not risk-free. The key risks to manage are:

How Fintiq's Pairs Tab Works

Fintiq has built a dedicated Pairs tab that automates the cointegration analysis workflow. Here is how to use it:

  1. Enter two tickers: Input any two LSE-listed stock tickers (e.g., BP. and SHEL for BP and Shell).
  2. Set the lookback window: Choose 1, 2, or 3 years of historical data. Longer windows give more robust results but may include outdated relationship dynamics. Two years is generally a good balance.
  3. Review the ADF test result: Fintiq displays the ADF p-value prominently. A p-value below 0.05 indicates statistically significant cointegration at the 5% level.
  4. Review the spread chart: Fintiq plots the historical spread between the two stocks along with its mean and +2/-2 standard deviation bands. You can visually verify that the spread has historically reverted to the mean after divergences.
  5. Check the current Z-score: Fintiq displays the current Z-score of the spread. A Z-score outside +/-2 represents a potential trading opportunity.
  6. Review entry/exit signal flags: Fintiq automatically flags when the current Z-score crosses the +2 or -2 threshold, suggesting a potential entry point, and when it returns toward 0, suggesting a potential exit.

For a deeper dive into constructing a complete pairs trading strategy — including position sizing, stop-loss rules, half-life of mean reversion, and a full step-by-step Fintiq walkthrough — see our Pro guide: Pairs Trading with Cointegration: A Practical Guide.

Ready to put this into practice?

Use Fintiq's free tools to screen stocks, run Monte Carlo simulations, and optimise your portfolio.

Launch Fintiq Free →