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.