Statistical1 min read
◆ The PatternHow widely values spread around their mean, the single number most of risk measurement is built on
Standard Deviation — the statistical building block of volatility measurement.
σ = √(Σ(x − μ)² / N)
where μ = mean, N = number of observations
where μ = mean, N = number of observations
Higher σ = more volatility = prices are spread far from the mean.
In markets:
• Historical Volatility = σ of returns × √252 (annualized)
• For normal data, 1σ covers ~68% and 2σ ~95% → the basis of Bollinger Bands
• 3σ events are "rare" but happen more often in markets than normal distributions predict (fat tails)
• Historical Volatility = σ of returns × √252 (annualized)
• For normal data, 1σ covers ~68% and 2σ ~95% → the basis of Bollinger Bands
• 3σ events are "rare" but happen more often in markets than normal distributions predict (fat tails)
Worked example
Day 15: the last five closes (104, 102, 99, 101, 104) average 102.0. The deviations are 2, 0, −3, −1 and 2; squared, 4, 0, 9, 1 and 4; their mean is 3.6, and its square root 1.90. Measured on daily returns instead of prices it is about 2.6% a day — returns are what risk models use.
The example data: 15 days, used in every indicator here
| Day | High | Low | Close | Volume |
|---|---|---|---|---|
| 1 | 101 | 99 | 100 | 50,000 |
| 2 | 103 | 100 | 102 | 62,000 |
| 3 | 103 | 100 | 101 | 48,000 |
| 4 | 105 | 101 | 104 | 70,000 |
| 5 | 108 | 104 | 107 | 85,000 |
| 6 | 108 | 105 | 106 | 60,000 |
| 7 | 110 | 106 | 109 | 90,000 |
| 8 | 110 | 107 | 108 | 72,000 |
| 9 | 108 | 104 | 105 | 80,000 |
| 10 | 105 | 102 | 103 | 66,000 |
| 11 | 105 | 102 | 104 | 55,000 |
| 12 | 104 | 101 | 102 | 75,000 |
| 13 | 102 | 98 | 99 | 95,000 |
| 14 | 102 | 99 | 101 | 64,000 |
| 15 | 105 | 101 | 104 | 71,000 |
Where it misleads
- It treats moves up and down alike, so a sharp rally counts as “risk” the same as a fall.
- It assumes the spread is stable. Volatility clusters, so after a calm spell yesterday’s figure understates tomorrow’s.
- Returns have fat tails: extreme days come far more often than a bell curve with this standard deviation predicts.
In code
df['sd5'] = df['close'].rolling(5).std(ddof=0) df['ret_sd5'] = df['close'].pct_change().rolling(5).std() # the same idea on returns
Assumes import numpy as np, import pandas as pd, and a DataFrame df with columns high, low, close and volume — the 15 days above.
Sources
- B. Mandelbrot, “The Variation of Certain Speculative Prices”, Journal of Business 36(4), 1963 — fat tails in prices
- J. C. Hull, Options, Futures, and Other Derivatives, Pearson — estimating volatility from returns
Last reviewed October 2026 · How this site checks its content · Report a mistake
Pattern bridge: This is standard deviation from statistics, applied to price returns. In ML, it’s the denominator in batch normalization and the width of Gaussian distributions.
Linked from 12
- Chart PatternsBroadening FormationDiverging trendlines — expanding volatility, increasing disagreement
- Chart PatternsEngulfingThe second candle swallows the first — momentum shift
- Chart PatternsPennantSmall symmetrical triangle on a pole — brief pause before continuation
- Technical IndicatorsAverage Directional IndexHow strongly price is trending, whichever way it goes: strength without direction
- Technical IndicatorsAverage True RangeVolatility as the typical size of a bar, gaps included, the yardstick for stops and position size
- Technical IndicatorsVWAP BandsStandard-deviation bands around VWAP: how far price has drifted from where volume puts fair value
- Market PsychologyFear & GreedThe two dominant market emotions.
- Risk & PortfolioBenchmark TrackingTracking error measures deviation from the benchmark
- Risk & PortfolioCurrency HedgingNeutralize FX exposure in global portfolios
- ML MathLoss FunctionsMeasuring how wrong the model is — the objective being minimised
- ML MathMLE & GaussianMaximum Likelihood Estimation — why MSE and Cross-Entropy exist
- ML MathPCAFinding the directions of maximum variance for dimensionality reduction