Camovia Tray™

Standard Deviation Indicator

StdDev is the mathematical source of volatility: the average dispersion of price around its mean — the width inside Bollinger Bands, ATR's sibling, the base ruler for every "volatility state" read.

What it is

The Standard Deviation (StdDev) indicator measures how far the last N closes disperse from their mean: σ = √(Σ(Close − MA)² ÷ N). It answers "how agitated has the market been" — high readings mean price roams far from the mean (high volatility), low readings mean price huddles near it (low volatility). It is the mathematical source of volatility measurement: Bollinger's ±2σ, annualized volatility in quant finance, implied volatility in options — all built on it. MT5's default period is 20.

Origin

Standard deviation as a statistical concept dates to the 19th century (the Gauss/Pearson lineage); technical analysis adopted it as the common language of volatility. Bollinger Bands (John Bollinger, 1980s) popularized the ±2σ channel — the StdDev indicator itself is the naked volatility reading: no channel structure, just the number. MT5's iStdDev supports multiple MA algorithms and applied prices.

Download Camovia Tray free — check quotes, manage positions, and hide in one click from your system tray.

Download Free

The formula

The computation (MT5 default SMA20):

Mean MA = SMA(Close, 20)
Squared deviations = Σ(Close − MA)² (over 20 bars)
StdDev = √(squared deviations ÷ 20)

Convention watch: MT5 uses the population standard deviation (divide by N); some statistical software uses the sample version (divide by N−1) — readings differ slightly. The indicator allows choosing the MA method and applied price — different combos read differently; align conventions before comparing analyses.

Worked example

An example building the "volatility state" intuition:

  1. Two weeks of range: closes huddle inside 100±1 → StdDev ≈ 0.5 — volatility compressed, the market quiet.
  2. Breakout: consecutive wide bars push price away from the old mean → StdDev surges past 3 — volatility expanding, the market agitated.
  3. Mature trend: price consolidates at highs → StdDev falls from its peak but stays above the range-era level — moderate volatility, trend continues.

The StdDev curve itself is the volatility cycle — compression → expansion → decay, fully visible. A low StdDev is "the calm before the storm"; a high one, "the storm in progress".

How to read it

Reading StdDev (the historical-relative method):

Range Common interpretation
StdDev at a historical low Volatility compressed — a coiling range, breakout brewing (the same read as a Bollinger squeeze)
StdDev lifting fast Volatility expanding — the typical start of a new trend or a major move
StdDev at a historical high Extreme volatility — cut size, widen stops, or stand aside
StdDev falling from highs Volatility decaying — the trend maturing or exhausting
A low plateau turning up The first signal of compression ending — a breakout pre-warning

StdDev has no direction and no OB/OS — it is a pure "state" indicator: readings must be compared against the instrument's own history (absolute values do not compare across symbols), and the direction of change matters more than the level.

Common signals & usage

Compression → expansion

A long low plateau followed by a fast lift — quantified confirmation of a breakout launch; enter with the squeeze/breakout structure.

Extreme-volatility downsizing

StdDev spiking to an extreme percentile (e.g. 95%) — re-evaluate size and stops entirely, or stand aside.

Volatility-decay tracking

StdDev falling week by week from a peak inside a trend — the move maturing; downshift trend strategies.

Calibrating other tools with StdDev

Use StdDev readings to dynamically widen envelopes or scale stop multiples — a plain-vanilla "adaptive parameter" implementation.

Limitations & common mistakes

  • No direction information: StdDev measures dispersion only — rallies and crashes raise it equally; direction always comes from trend tools.
  • Absolute values do not compare across symbols: a $2 StdDev means different things on a $20 and a $400 stock — use the relative form (StdDev ÷ price).
  • Lags volatility shocks: a 20-period window reacts to sudden changes 2–3 days late — during events the actual volatility dwarfs the reading.
  • The ATR trade-off: both measure volatility with different geometry (dispersion vs true range) — StdDev is sensitive to deviation from the mean, ATR to each bar's path; stops usually use ATR, state reads use StdDev.
  • Convention traps: the MA method, applied price and population-vs-sample choices all change the reading — align before comparing.

StdDev in MT5

StdDev is a built-in MT5 oscillator (single line, sub-window). The MQL5 function for programmatic use is iStdDev:

int iStdDev(string symbol, ENUM_TIMEFRAMES period, int ma_period, int ma_shift, ENUM_MA_METHOD ma_method, ENUM_APPLIED_PRICE applied_price);
MQL5 function iStdDev()
Default parameters ma_period=20, ma_method=SMA
Algorithm √(Σ(Close−MA)² ÷ N) (population form)
Buffers 0=main buffer (StdDev value)
Display window Sub-window (readings in price units)

iStdDev exposes the MA method and applied price — different choices give different readings. Bollinger Bands compute the same family of σ internally (iBands' deviation parameter is a multiple of σ). In code, divide StdDev by price to get a percentage volatility for cross-instrument use.

Behavior across timeframes

15-minute

The intraday volatility switch: avoid low-StdDev sessions (midday), enable strategies in high-StdDev ones (open/close)

1-hour / 4-hour

Swing volatility-state monitoring; the compression→expansion confirmation period

Daily

The classic habitat: the 20-period StdDev volatility cycle is most complete on dailies

Weekly

Weekly extremes map to macro-event cycles — a background risk ruler for long-term books

Indicator combinations

Common pairings for StdDev:

  • With Bollinger Bands: the band width is ±2σ visualized — the StdDev histogram adds numeric precision to squeeze/expansion reads. BOLL
  • With ATR: StdDev governs the volatility state (compression/expansion), ATR governs stop placement (each bar's path) — state and execution divided. ATR
  • With ADX: a low StdDev + low ADX + Bollinger squeeze all together — the classic triple signature of "the eve of a big move". ADX

FAQ

Q Is a StdDev of 2.5 high or low?

Unanswerable without history — absolute values do not compare across symbols or eras. The correct read is historical-relative: its percentile within the past year of its own readings (e.g. the 80th = elevated). For cross-symbol comparison use StdDev ÷ price.

Q StdDev and ATR both measure volatility — which one?

Different jobs: StdDev measures average dispersion from the mean (deviation-sensitive); ATR measures each bar's true path (path-sensitive, gaps included). Stops and sizing usually use ATR; volatility-state cycles (compression/expansion) usually use StdDev — together they complement.

Q Is Bollinger's σ the same calculation as the StdDev indicator?

Same family: Bollinger uses the 20-period standard deviation of closes × 2 for the channel (±2σ); the StdDev indicator outputs the same family of readings naked. Detail conventions differ (Bollinger fixes SMA and population form; MT5's StdDev allows MA choice) — with identical settings the values match.

Q Can StdDev predict the breakout direction?

No. It measures "how volatile" not "which way" — a low StdDev (compression) only says a break is brewing; direction belongs to the breakout structure. Pair it with the Bollinger squeeze (position) and the breakout bar (direction); StdDev merely confirms that volatility is expanding.

Q How do I add StdDev in MT5?

Menu: Insert → Indicators → Oscillators → Standard Deviation, or drag it from the Navigator onto a sub-window. Defaults: period 20, SMA, Close — readings are in price units (different heights across instruments are normal).

Turn MT5 / MT4 into a Tray Tool

Check quotes, manage positions, and hide in one click.

Download Camovia Tray

This page is educational content about a technical indicator. It is not investment advice. Indicator signals can and do fail — always combine them with your own risk management.