ArchitectureStrategiesResearchWhy UsPricing

Standard Deviation

A statistical measurement of the dispersion of a price or return series around its arithmetic mean, serving as the foundational building block for volatility metrics, Bollinger Bands, and z-score standardisation.

Standard deviation (σ\sigma) measures how widely values in a dataset disperse around their arithmetic mean. In quantitative trading and portfolio management, it is the primary statistical measure of price variability and historical risk. When applied to daily returns, it forms the basis of realised volatility and risk-adjusted metrics like the Sharpe Ratio; when applied to rolling price windows, it powers adaptive indicator envelopes like Bollinger Bands.

Mathematical Formulation

In financial time-series analysis, standard deviation is computed using the sample formulation with Bessel’s correction (N−1N-1) to provide an unbiased estimator of variance:

1. Sample Variance (s2s^2)

s2=1N−1∑i=1N(xi−xˉ)2s^2 = \frac{1}{N-1} \sum_{i=1}^N (x_i - \bar{x})^2

Where:

  • NN: Number of observations in the sample or rolling window
  • xix_i: Observed value at step ii (daily return rir_i or asset close price PiP_i)
  • xˉ\bar{x}: Arithmetic sample mean (1N∑i=1Nxi\frac{1}{N}\sum_{i=1}^N x_i)

2. Sample Standard Deviation (ss or σ\sigma)

s=1N−1∑i=1N(xi−xˉ)2s = \sqrt{\frac{1}{N-1} \sum_{i=1}^N (x_i - \bar{x})^2}

3. Annualised Standard Deviation on Indian Exchanges

When calculated on daily percentage log or arithmetic returns, standard deviation is scaled to an annualised basis assuming independent and identically distributed (i.i.d.) returns:

σannual=σdaily×T\sigma_{\text{annual}} = \sigma_{\text{daily}} \times \sqrt{T}

Where TT represents the number of annual trading sessions on the National Stock Exchange of India (250 to 252 trading days, accounting for clearing holidays and weekends).

Key Applications in Systematic Trading

MechanismFormula / IntegrationRole in Indian Markets
Bollinger BandsUpper=SMAn+k⋅σn\text{Upper} = \text{SMA}_n + k \cdot \sigma_nQuantifies rolling 20-day closing price envelope to spot overextended swings or volatility compressions.
Z-Score Normalisationz=x−μσz = \frac{x - \mu}{\sigma}Standardises cross-sectional fundamental and technical factors across NSE 500 stocks for fair multi-factor ranking.
Sharpe & Sortino RatiosSharpe=Rp−Rfσp\text{Sharpe} = \frac{R_p - R_f}{\sigma_p}Penalises return by standard deviation of excess returns to evaluate risk-adjusted quality.
Volatility Targetingwt=min⁡(1.0,σtargetσportfolio)w_t = \min\left(1.0, \frac{\sigma_{\text{target}}}{\sigma_{\text{portfolio}}}\right)Scales equity exposure inversely to portfolio return standard deviation to prevent catastrophic drawdowns.

Calculation on Indian Equities with Worked Example

Consider calculating the 5-day rolling sample standard deviation for an NSE large-cap stock trading over five consecutive sessions:

1. Daily Closing Prices (₹)

  • Day 1: ₹2,450.00
  • Day 2: ₹2,480.00
  • Day 3: ₹2,420.00
  • Day 4: ₹2,510.00
  • Day 5: ₹2,490.00
  • Sample Size (NN): 5 sessions

2. Step-by-Step Computation

  1. Calculate the Arithmetic Mean (Pˉ\bar{P}): Pˉ=2450+2480+2420+2510+24905=12,3505=2,470.00(₹2,470.00)\bar{P} = \frac{2450 + 2480 + 2420 + 2510 + 2490}{5} = \frac{12,350}{5} = \mathbf{2,470.00} \quad (\text{₹2,470.00})

  2. Compute Deviations and Squared Differences:

    • Day 1: (2450−2470)2=(−20)2=400(2450 - 2470)^2 = (-20)^2 = 400
    • Day 2: (2480−2470)2=(10)2=100(2480 - 2470)^2 = (10)^2 = 100
    • Day 3: (2420−2470)2=(−50)2=2,500(2420 - 2470)^2 = (-50)^2 = 2,500
    • Day 4: (2510−2470)2=(40)2=1,600(2510 - 2470)^2 = (40)^2 = 1,600
    • Day 5: (2490−2470)2=(20)2=400(2490 - 2470)^2 = (20)^2 = 400
  3. Sum of Squared Differences: ∑i=15(Pi−Pˉ)2=400+100+2500+1600+400=5,000\sum_{i=1}^5 (P_i - \bar{P})^2 = 400 + 100 + 2500 + 1600 + 400 = 5,000

  4. Compute Sample Variance (s2s^2) with N−1N - 1 Degrees of Freedom: s2=5,0005−1=5,0004=1,250s^2 = \frac{5,000}{5 - 1} = \frac{5,000}{4} = 1,250

  5. Compute Sample Standard Deviation (ss): s=1,250≈35.36(₹35.36)s = \sqrt{1,250} \approx \mathbf{35.36} \quad (\text{₹35.36})

Under a 20-period Bollinger Band with multiplier k=2k=2, an equivalent ₹35.36 standard deviation would place the upper band at ₹2,470 + (2 \times ₹35.36) = ₹2,540.72 and lower band at ₹2,470 - (2 \times ₹35.36) = ₹2,399.28.

Practical Considerations & Caveats

  • Fat Tails (Leptokurtosis): Standard deviation assumes a Gaussian (normal) distribution where 99.73% of observations fall within ±3σ\pm 3\sigma. Real Indian equity returns exhibit heavy tails (fat tails) and positive excess kurtosis; 3-sigma and 4-sigma gap-down events occur far more frequently during market shocks (e.g., March 2020 COVID sell-off) than normal distribution theory predicts.
  • Equal Weighting of Outliers: Because differences are squared, a single outlier day (such as a 15% post-earnings circuit limit move) heavily inflates standard deviation for the entire duration of the rolling window, even after the asset resumes quiet trading.
  • Directional Indifference: Standard deviation penalises upside surprises identically to downside crashes. For asymmetric downside risk assessment, quantitative investors complement standard deviation with downside semi-deviation or the Sortino Ratio.
Back to Glossary