Vulcan Trading
Updated
A concept, explained

What is cointegration, and why does a pairs trade care about it?

Two prices can wander apart forever, or something structural can tie them so that gaps between them tend to close. Cointegration is the test that tells you which. Correlation tells you how two prices have moved together in the past. Cointegration asks whether a relationship exists that pulls the spread back - and those are not the same question.

Where you are. You have two stocks that have moved together for months, the spread has opened, and every instinct says it closes. You are about to act on the chart alone.

You have watched two names track each other for months. The spread has opened, and every instinct says it closes. The chart looks clean. The relationship looks real. You are about to act on it.

Before you do, there is a question the chart cannot answer.

The correlation problem

When two prices move together, correlation captures that. It measures the direction and the strength of their co-movement over a chosen window. What it does not measure is whether anything ties their levels together - whether a gap that opens has any structural reason to close.

Two prices can be highly correlated and still drift apart indefinitely. If both are trending - even trending in the same direction - the spread between them can widen without limit. Correlation describes the past moves. It says nothing about whether the relationship has a centre of gravity.

Cointegration is the question beneath the question. It asks: is the spread between these two prices stationary? A stationary spread has a mean it tends to return to. A non-stationary spread is just noise with no anchor. When you go long one name and short another, you hold the spread. If the spread has no tendency to revert, the trade has no premise.

What the test actually measures

Stocks Lab runs an Augmented Dickey-Fuller test on the spread. The ADF test is asking whether the spread has a unit root - whether it behaves like a random walk with no pull toward a mean, or whether it is mean-reverting. The result is a p-value: a low p-value is evidence against the random walk, which is evidence for stationarity.

Before the spread is tested, the surface calculates a hedge ratio - the weighting that constructs the spread so that the common trend between the two prices is as neutralised as possible. The hedge ratio is not decoration. It is the definition of the spread you are actually testing. Get it wrong and you are testing something that was never a pair to begin with.

Then the half-life. Knowing the spread is stationary is a structural condition. Knowing how long the spread typically takes to revert - its half-life - gives the trade its shape. Say, as an example on a synthetic labelled series, the hedge ratio comes out at one point three and the half-life at nine days. Both of those numbers tell you something different: one point three says how much of one name offsets a unit of the other; nine days says that, historically on this series, a deviation tends to be half-closed in about nine sessions. A half-life measured in sessions and a half-life measured in weeks can both pass the test. Only one of them fits a given desk's horizon.

What the test cannot tell you

Cointegration is a test of long-run structure. It is not a guarantee that the spread will behave the same way going forward. The relationship can break - a corporate event, a regime change in volatility, a shift in the correlation between the underlying drivers of two prices. The spread can have been stationary for years and stop being so.

This is where the regime layer becomes a separate question. The rolling Hurst exponent and the hidden Markov model regime read on Stocks Lab address whether the spread is currently behaving like itself - mean-reverting - or whether the character of the relationship has shifted. Structure and regime are two different readings. Cointegration answers the first. The regime layer answers the second.

When the cointegration test fails, Stocks Lab does not remove the cells or soften the result. It shows NOT COINTEGRATED, and it caps its own confidence at a quarter - because past that, the test is not telling you anything the evidence supports. Every cell still renders: the p-value, the hedge ratio, the half-life, the spread z-score, the regime line, the next-hour forecast, with the charts marked for reference. The cap is the refusal, and the refusal is the point. The surface is telling you the structural condition is not there, before you act on the chart that looked clean.

A year of two prices tracking together is a correlation observation. It is not evidence of stationarity. The test is what separates the two.

Open Stocks in the Retail view, pick any two names you watch, and read the cointegration line before you look at the spread chart.

Where this lands in Vulcan Trading. The pairs lab with a pair that failed the cointegration test: the gate line first, the cells that produced it, the regime layer, and a confidence bar the surface capped itself.
  1. The gate. The test failed, the surface says so in words, and gives the p-value that failed it.
  2. The cells behind the test: ADF p-value, hedge ratio, half-life, spread z-score, and the bars in the sample.
  3. The regime layer above the pair: Hurst and HMM P(calm), read together.
  4. Confidence hard-capped because the test failed. The prediction cells to its left are blanked here.
Masked in this clip: the predicted next-hour value, the current price and the delta beside them. The clip runs the lab on two pairs in turn: the inputs, the gate line with its p-value, the ADF, hedge-ratio, half-life, z-score and bars cells, the Hurst and HMM regime line, the capped confidence bar, and the price and spread charts beneath.

The objection

You might say
The chart shows them tracking for a year. Why is that not enough?
The answer
Because two prices can drift together by chance and never come back. Correlation describes the past moves; cointegration asks whether something ties the pair so a gap tends to close. The lab runs that test first, and when it fails it says NOT COINTEGRATED and caps its own confidence - which is the answer you wanted before you acted on anything.

How Vulcan Trading computes this

Surface
Stocks Lab
What it does
Statistical pair research across US equities and FX: cointegration, regime, an FFT-denoised spread and a one-step-ahead forecast.
Instruments
US equities + FX pairs
Method
The forecast caps its own confidence when the test behind it fails, and says so on the screen. Smoothed historical curves are marked as computed in-sample.
Engine
pair-trading engine (cointegration-gated)

Described as capability. This page reproduces no figure from the product and nothing on it is a live read; the method is the point, not a result.

First action

Open Stocks in the Retail view, pick any two names you watch, and read the cointegration line before you look at the spread chart.

See it on the surface, free. One free account opens the Retail view: the desk, the watchlist, Stocks with the pairs lab inside it, Gold Vault, Order Flow, Forecast and Replay. No card. You are leaving a page about method for a product that applies it. The page stays here.

Create a free account

See it on your own book. A pilot on your firm's holdings: the portfolio surfaces plus a desk analyst, on a contract outside the card, with the outcome measure agreed up front. Ask for a pilot.

Next in this path

Door You trade spreads and one drifted · page 1 of 6

If a spread mean-reverts, how long is the wait?The ADF test and half-life, for people who trade spreads

Door You run your own systems and the signal is in someone else's app · page 3 of 3

That is the end of this path. Pick another door, or read on below.

Sources