# Close-to-close Historical Volatility

Also known as: standard deviation of log returns.
A Volatility concept (Volatility estimators) in the LuxAlgo Library, with 1 indicator implementation.

## What is Close-to-close Historical Volatility?

Close-to-close historical volatility is the standard deviation of logarithmic returns computed from closing prices, usually annualized and quoted as a percentage. Each period's return is the natural log of the current close divided by the prior close; the estimator takes the standard deviation of those returns over a lookback window and multiplies by the square root of the number of periods per year (√252 is the convention for daily data on markets with roughly 252 trading days). It is the oldest and most widely quoted volatility estimator, and the default meaning of "historical volatility" or "HV" unless another estimator is named.

Its strengths and weaknesses both come from using only closes. It needs no open, high, or low data, it captures overnight gaps because each close-to-close return spans them, and it makes minimal assumptions. But it discards everything price did inside the bar, so range-based estimators such as the [Parkinson estimator](https://www.luxalgo.com/library/concept/parkinson-estimator/) or the [Yang-Zhang estimator](https://www.luxalgo.com/library/concept/yang-zhang-estimator/) can reach similar precision from less data by using each bar's high-low information. It also lags by construction: one large return inflates the estimate for the whole window and then drops out abruptly, which is a key motivation for exponentially weighted variants.

## How to calculate close-to-close historical volatility

The calculation is four short steps; the only real choices are the lookback window and the annualization factor.

1. Compute log returns: for each bar, take the natural logarithm of the close divided by the previous close.
2. Take the standard deviation of those returns over the lookback window (20 and 30 periods are common on daily data); some implementations assume a zero mean rather than subtracting the sample mean, which matters little at daily horizons.
3. Annualize by multiplying by the square root of the number of periods per year: √252 for daily equity data, √365 often used for markets that trade every day, √52 for weekly data.
4. Express the result as a percentage, so 0.25 reads as 25% annualized volatility, comparable across instruments and against [implied volatility](https://www.luxalgo.com/library/concept/implied-volatility/) quotes.

## How it's calculated

Annualized standard deviation of close-to-close log returns, the standard realized volatility estimate.

```
r_t = ln(C_t / C_(t-1))
m = (1 / n) × Σ over i = 0..n-1 of r_(t-i)
s_t = sqrt( (1 / (n - 1)) × Σ over i = 0..n-1 of (r_(t-i) - m)^2 )
HV_t = s_t × sqrt(A)
Quoted as a percentage: HV_t × 100

  C_t: close of bar t
  C_(t-1): close of the prior bar
  r_t: log return of bar t
  r_(t-i): log return i bars before t
  ln(): natural logarithm
  n: lookback window in bars (commonly 20 or 30)
  m: mean log return over the window
  s_t: per-bar sample standard deviation of log returns
  A: periods per year for annualization (252 for daily bars)
  HV_t: annualized historical volatility as a decimal
  i: bar offset within the window
  t: bar index
```

The sample divisor (n - 1) is most common; some implementations divide by n or assume a zero mean.

Match A to the bar frequency: 252 daily, 52 weekly, 12 monthly.

This estimator ignores intrabar range; Parkinson and Garman-Klass estimators use high/low data for more efficiency.

## How traders use it

- As a regime gauge: comparing current HV to its own history, often via a [volatility percentile](https://www.luxalgo.com/library/concept/volatility-percentile-rank/), classifies quiet versus active conditions and drives regime-switching logic.
- As the realized leg in options analysis: the spread between implied volatility and trailing HV frames whether options are priced rich or cheap relative to what the underlying has actually delivered.
- As a risk denominator: [volatility-targeted sizing](https://www.luxalgo.com/library/concept/volatility-targeted-sizing/) and stop-distance rules scale positions by HV so risk per trade is more uniform across instruments and regimes.
- As the benchmark estimator: more elaborate volatility estimators are routinely judged by how much efficiency they add over plain close-to-close on the same data.

## Close-to-close Historical Volatility vs related concepts

- **ATR** (https://www.luxalgo.com/library/concept/atr/): Measures average bar range in price units rather than the dispersion of percentage returns, and is not annualized. ATR suits stop distances on a single chart; HV supports cross-instrument comparison and options work.
- **Realized Volatility** (https://www.luxalgo.com/library/concept/realized-volatility/): In the academic sense, realized volatility sums squared intraday returns from high-frequency data to estimate a single day's volatility; close-to-close HV is the low-frequency cousin. In casual usage the two terms often blur.
- **EWMA Volatility** (https://www.luxalgo.com/library/concept/ewma-volatility/): Replaces the equal-weighted window with exponentially decaying weights, so recent returns dominate and a single large return fades out smoothly instead of dropping off a cliff when it leaves the window.

## FAQ

### Why does historical volatility use log returns instead of simple returns?

Log returns add across time (the log return over a week is the sum of the daily log returns), which makes square-root-of-time annualization internally consistent, and they treat up and down moves symmetrically. For small daily moves, log and simple returns are nearly identical, so the practical difference at typical horizons is minor.

### Why multiply by the square root of 252?

Annualization assumes returns are roughly independent across periods, so variance scales with time and standard deviation scales with its square root. With about 252 trading days in a US equity year, daily volatility times √252 gives an annual figure. Markets that trade every day often use √365 instead; the convention just needs to be stated and applied consistently.

### What lookback window should I use for historical volatility?

There is no single correct window. Short lookbacks (10 to 20 days) respond quickly but are noisy and jump when one large return enters or leaves the sample; longer ones (60 to 252 days) are stable but slow. A common practice is to match the window to the horizon you care about, or to track two windows and watch their ratio.

## Implementations in the Library

- Historical Volatility (LuxAlgo, the standard build of the classic formula): https://www.luxalgo.com/library/indicator/historical-volatility/

## Related concepts

- Volatility Estimators: https://www.luxalgo.com/library/concept/volatility-estimators/
- EWMA Volatility: https://www.luxalgo.com/library/concept/ewma-volatility/
- Parkinson Estimator: https://www.luxalgo.com/library/concept/parkinson-estimator/
- Garman-Klass Estimator: https://www.luxalgo.com/library/concept/garman-klass-estimator/
- Rogers-Satchell Estimator: https://www.luxalgo.com/library/concept/rogers-satchell-estimator/
- Yang-Zhang Estimator: https://www.luxalgo.com/library/concept/yang-zhang-estimator/
- Garman-Klass–Yang-Zhang Hybrid: https://www.luxalgo.com/library/concept/garman-klass-yang-zhang-hybrid/
- Jump Detection: https://www.luxalgo.com/library/concept/jump-detection/
- Volatility Signature Plot: https://www.luxalgo.com/library/concept/volatility-signature-plot/
- Volatility of Volatility: https://www.luxalgo.com/library/concept/volatility-of-volatility/

---

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