# Volatility Switch

A Volatility concept (Regime & compression) in the LuxAlgo Library, with 1 indicator implementation.

## What is the Volatility Switch?

The Volatility Switch is a bounded volatility-regime gauge proposed by Ron McEwan (Technical Analysis of Stocks & Commodities, 2013). It measures short-horizon volatility from one-bar relative price changes, then expresses the current value as a percentile rank within its own trailing history. The output therefore lives between 0 and 1 on any instrument: readings above 0.5 mean volatility is elevated relative to its recent past, readings below 0.5 mean it is subdued.

The bounded scale is the point. In the common reading, high values mark regimes where price action turns choppy and mean-reverting tactics have the stronger claim, while low values mark quiet conditions in which trends are more likely to persist. That makes the switch a compact form of volatility regime classification: one normalized line that routes strategy selection. Like any regime filter it is backward-looking, lags at transitions, and says nothing about direction.

Mechanically the calculation has three steps. Each bar's change is measured relative to the average of the current and prior price, a symmetric one-bar return; the standard deviation of those changes over a short window forms a compact [realized volatility](https://www.luxalgo.com/library/concept/realized-volatility/) estimate; and that estimate is percentile-ranked against its own recent readings, with common implementations defaulting to 21 bars, roughly a month of daily data, for both windows. The output is the fraction of recent readings at or below today's, which pins the scale between 0 and 1.

Its appeal is portability. Because the output is a rank, the 0.5 line means the same thing on an index future, a currency pair, or a small-cap stock, with no per-symbol tuning, which is why the switch drops easily into larger systems as a regime filter. The design also has a blind spot: it knows nothing about absolute movement, so practitioners keep a price-denominated gauge such as [ATR](https://www.luxalgo.com/library/concept/atr/) alongside it for stop distances and sizing. The same normalization applied to any input is the broader [volatility percentile](https://www.luxalgo.com/library/concept/volatility-percentile-rank/) approach; the switch is that idea with fixed ingredients and a published decision line.

## How to read the Volatility Switch on a chart

The indicator draws one line between 0 and 1 in its own pane; the reading is about level and persistence.

1. Add a Volatility Switch indicator (community ports are widely available) and mark the 0.5 midline.
2. Read the side: above 0.5 is a relatively high-volatility regime, below 0.5 a relatively quiet one.
3. Weight persistence over single crossings; a line holding one side for many bars is a regime, a one-bar poke is noise.
4. Sanity-check extremes against the chart: readings near 1 should coincide with wide, gappy candles, readings near 0 with tight ranges and narrowing [Bollinger Bands](https://www.luxalgo.com/library/concept/bollinger-bands/).
5. Avoid cross-symbol comparisons; the scale is relative to each instrument's own recent history, not to any absolute level.

## How it's calculated

A bounded gauge that percentile-ranks current short-horizon volatility within its own trailing history.

```
r_t = (C_t - C_{t-1}) / ((C_t + C_{t-1}) / 2)
rbar_t = (1/n) × Σ r_{t-i} over i = 0..n-1
Vol_t = sqrt( (1/n) × Σ (r_{t-i} - rbar_t)^2 over i = 0..n-1 )
VS_t = (1/n) × Σ [Vol_{t-i} <= Vol_t] over i = 0..n-1
Regime read: high volatility while VS_t > 0.5, low volatility while VS_t < 0.5

  C_t: close of bar t (C_{t-1} is the prior close)
  t: bar index
  i: bar offset inside the lookback window
  r_t: one-bar relative price change, measured against the two-bar midpoint price
  n: lookback length (default 21)
  rbar_t: mean of r over the last n bars
  Vol_t: standard deviation of r over the last n bars
  [condition]: 1 when the condition is true, else 0
  VS_t: Volatility Switch value, between 1/n and 1
```

Published by Ron McEwan as The Volatility (Regime) Switch Indicator (Technical Analysis of Stocks & Commodities, February 2013); the midpoint denominator keeps the one-bar change symmetric, though some ports use a plain percent change.

The output is a percentile rank of volatility against itself, so it is comparable across instruments; McEwan's read favors mean reversion above 0.5 and trend following below.

Population (1/n) versus sample (1/(n-1)) standard deviation barely changes the rank, and both appear in implementations.

## How traders use it

- As a strategy router, the use McEwan proposed: run mean-reversion logic while the switch reads above 0.5 and trend-following logic below it, rather than trading the line as a signal in itself.
- As a gate on signal type: some systems only honor breakout and momentum entries while the switch sits in the low-volatility half of its range, on the logic that elevated readings mark conditions where follow-through is less reliable.
- As a quiet-market flag: extended stretches near the bottom of the scale mark compression, the setup condition [range expansion](https://www.luxalgo.com/library/concept/range-expansion-contraction/) traders watch for, though the switch says nothing about when the expansion comes or in which direction.
- As sizing and stop context: persistent high readings argue for smaller size and wider stops even when tactics stay unchanged; pairing the switch with [ATR bands](https://www.luxalgo.com/library/concept/atr-bands/) converts the regime call into concrete distances.
- As a bounded confluence input: living on a fixed 0-1 scale, the switch drops cleanly into composite scores beside other normalized gauges, adding a volatility dimension without rescaling.

## Volatility Switch vs. related volatility gauges

- **Volatility Percentile/rank** (https://www.luxalgo.com/library/concept/volatility-percentile-rank/): The percentile approach ranks any volatility measure over any window; the Volatility Switch is one specific recipe, one-bar relative changes and roughly a month of history, with 0.5 as the published line. Same normalization, fixed ingredients and defaults.
- **ATR** (https://www.luxalgo.com/library/concept/atr/): ATR states typical bar range in price units, so it feeds stops and targets directly but needs a baseline before it says whether volatility is unusually high. The switch answers high-or-low natively while carrying no price-unit information; many systems run both.
- **TTM Squeeze** (https://www.luxalgo.com/library/concept/ttm-squeeze/): The TTM Squeeze flags one condition, Bollinger Bands inside Keltner Channels, and aims to anticipate expansion out of compression. The switch grades the entire regime continuously and aims at routing tactics rather than timing breakouts.

## FAQ

### What does it mean when the Volatility Switch is above 0.5?

It means current short-horizon volatility ranks in the upper half of its own recent history, so the instrument is in a relatively high-volatility regime; the common playbook favors mean-reversion over trend-following there. Note it is purely relative: a 0.7 reading on a quiet instrument can be calmer in absolute terms than a 0.3 reading on a volatile one.

### Is the Volatility Switch the same as the Choppiness Index?

No. Both try to separate trending from choppy conditions, but the Choppiness Index is built from the ratio of summed true ranges to the net high-low range of the window, while the Volatility Switch percentile-ranks realized volatility against its own history. Because they measure different things they can disagree: a fast one-directional selloff can read as strongly trending on the Choppiness Index while pushing the switch to its high-volatility extreme. Neither one indicates direction.

### Who created the Volatility Switch indicator?

Ron McEwan, in a 2013 article in Technical Analysis of Stocks & Commodities. It reached a wide audience through community ports on charting platforms, most visibly LazyBear's TradingView version, which credits McEwan's article.

### What settings does the Volatility Switch use?

Common implementations default to 21 bars, about a month of daily data, for both the volatility estimate and the ranking window. Shorter windows change regime faster but flip more often; longer ones are steadier and slower. Treat 21 as a convention to test rather than a rule.

### Does the Volatility Switch work on intraday charts?

It computes on any timeframe, needing only closes. Intraday, volatility follows the clock, running hotter around session opens and closes, so the rank can cycle with time of day; a common workaround is reading the switch from a higher timeframe.

### Is the Volatility Switch a buy or sell signal?

No. It contains no directional information; it grades conditions. The published use is selecting which tactic to run, mean reversion while readings sit above 0.5 and trend-following below, with entries, exits, and risk supplied by other tools.

## Implementations in the Library

- Volatility Switch (LuxAlgo): https://www.luxalgo.com/library/indicator/volatility-switch/

## Related concepts

- Range Expansion/contraction: https://www.luxalgo.com/library/concept/range-expansion-contraction/
- Choppiness Index: https://www.luxalgo.com/library/concept/choppiness-index/
- NR4/NR7 Narrow-range Bars: https://www.luxalgo.com/library/concept/nr4-nr7-narrow-range-bars/
- Volatility Contraction Pattern: https://www.luxalgo.com/library/concept/volatility-contraction-pattern/
- Gap-volatility Relation: https://www.luxalgo.com/library/concept/gap-volatility-relation/
- Damiani Volatmeter: https://www.luxalgo.com/library/concept/damiani-volatmeter/
- Waddah Attar Explosion: https://www.luxalgo.com/library/concept/waddah-attar-explosion/
- Volatility Regime Classification: https://www.luxalgo.com/library/concept/volatility-regime-classification/
- Weekend/overnight Volatility Profile: https://www.luxalgo.com/library/concept/weekend-overnight-volatility-profile/
- Event-driven Volatility: https://www.luxalgo.com/library/concept/event-driven-volatility/

---

Source: https://www.luxalgo.com/library/concept/volatility-switch/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/