The z-score puts the spread in its own standard deviations, so one set of bands can be read across periods

The z-score puts the spread in its own standard deviations, so one set of bands can be read across periodsUpper panel: Nifty 50: from 100 at 1 Jul 2025 to 91 at 15 Sep 2026, high 103 at 2 Jan 2026, low 87 at 30 Mar 2026. Nifty Bank: from 100 at 1 Jul 2025 to 97 at 15 Sep 2026, high 107 at 18 Feb 2026, low 87 at 30 Mar 2026. Lower panel: z-score of the spread, with 27 readings beyond 2 standard deviations.Both rebased to 100 at the startNifty 50Nifty Bank9095100105z score of the spread, in standard deviations01−12−2Jul 2025OctJan 2026AprJul
Nifty 50 and BANKNIFTY closes, 1 Jul 2025 to 15 Sep 2026, with the z-score of their spread below (60 session window, hedge ratio fitted on the whole sample, which a real test must not do). The bands are choices, and this is an illustration, not a recommended pair. Source: NSE end of day data, computed by RupeeCase. As of 15 Sep 2026.

Start with the spread, not with either price. Fit the hedge ratio on a training window by least squares on log prices, then form the spread as one log price less the hedge ratio times the other, minus an intercept.

The half life comes from regressing the change in the spread on its lagged level. If the slope is negative, the half life is about minus the natural log of two divided by the slope, in sessions. The exact form is minus ln 2 over ln(1 plus the slope). A slope near zero or positive means there is no pull back at a usable speed on that sample.

The z-score is the spread minus its rolling mean, divided by its rolling standard deviation. A window of a few half lives is a common starting point, not a law. Entry at a large absolute z-score, exit near zero and a stop further out are conventions that depend on costs and the sample.

The chart shows the z-score of a Nifty and BANKNIFTY pair on a 60 session window, with one and two standard deviation bands. On this sample the fitted half life runs for most of the sample length, far past that window, and the Engle Granger test does not reject, so the spread shows no usable pull back and the window is only a drawing choice. A z-score is not a cointegration test.

Two cautions. Choosing the window and the bands on the same data that then tests the trade is look ahead in disguise. Lot size rounding and futures rolls also change the effective hedge, so a clean z-score on paper can trade differently in practice.

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