Two index prices can trend together while their spread keeps wandering, so the test is on the spread
Correlation and cointegration sound alike. Correlation measures how closely two series move together in their daily changes. Cointegration is a claim about levels: some weighted combination of the two prices is stationary, so the gap between them keeps coming back to a middle value.
That difference matters for a pair. Two trending prices, such as two indices that climb with the economy, can show high correlation of returns while the gap between them wanders with no pull back. It looks related on a correlation table and offers no mean to trade toward.
The usual test is Engle and Granger. Regress one log price on the other to get a hedge ratio, then test the residual spread for a unit root with an augmented Dickey Fuller test. Use the Engle Granger critical values, -3.34 at the 5 percent level for two series with a constant, not the plain table. Johansen is the tool for three or more series.
The chart uses the Nifty 50 and BANKNIFTY closes from the NSE index files. The lower panel is a rolling z-score, which swings around zero by construction, so it cannot prove anything. The test runs on the whole spread. On this sample the daily changes are strongly correlated, yet the Engle Granger statistic sits far above the critical value, so the test does not reject. High correlation did not make this pair cointegrated.
Two cautions. The test runs on a past sample, so a pair chosen because it passed has already been fitted to it. And cointegration can break when the relation changes, for example after a change in index rules or composition, so the test needs to be run again on fresh data.
Before you trade. Derivatives trading carries a high risk of loss. SEBI's study "Profitability of Individual Traders in the Equity Derivatives Segment (FY25 to FY26)" (August 2026) found that 87.7% of individual traders in equity F&O made net losses in FY26, with aggregate net losses of Rs 91,685 crore. Read the SEBI study