Skip to content
All library documents

Garman–Klass Historical Volatility from OHLC Prices

Article Quant Q&A · Author: Stu

Summary

The document gives the Garman–Klass estimator for historical volatility using daily open, high, low, and close prices. For each observation, it combines the squared logarithm of the high-to-low ratio with a weighted squared logarithm of the close-to-open ratio. It then sums these daily terms over a chosen window, scales by the number of periods per year divided by the window length, and takes the square root to annualize the estimate.

The accompanying notation defines the annualization factor as the number of closing prices in a year and the window length as the number of historical prices used. The source says the estimator uses OHLC data, but does not explain its derivation, assumptions, or why the estimator works. It also does not define a variable called F; the displayed formula uses Z for the annualization factor. No empirical comparison or caveat about the estimator's use is provided.

Key ideas

  • The Garman–Klass estimator uses open, high, low, and close prices to estimate historical volatility.
  • It combines squared log high-to-low and close-to-open price ratios with different weights.
  • The summed estimate is annualized using the number of yearly closing periods and the observation window length.
  • The document defines Z as the annualization factor and does not explain the estimator's derivation.

Tags

Full text
# What is the equation for Garman-Klass volatility?


# What is the equation for Garman-Klass volatility?












I want to calculate realized/historical volatility for the underlying products of various options using the Garman-Klass estimator, but I can't see to find an equation, although I know it involves OHLC data. In the comments there is a link to the equation, but I still am looking for a little explanation. Why does this work? What is the variable "F"?

## Answer by Bob Jansen (score 13, accepted)

https://quant.stackexchange.com/a/11308

In the R TTR package the Garman-Klass volatility is given by

```
# Historical Open-High-Low-Close Volatility: Garman Klass
# https://web.archive.org/web/20100326172550/http://www.sitmo.com/eq/402
if( calc=="garman.klass" ) {
  s <- sqrt( N/n * runSum( .5 * log(OHLC[,2]/OHLC[,3])^2 -
             (2*log(2)-1) * log(OHLC[,4]/OHLC[,1])^2 , n ) )
}
```

which corresponds to*

$$ \sigma = \sqrt{ \frac{Z}{n} \sum \left[ \textstyle\frac{1}{2}\displaystyle \left( \log \frac{H_i}{L_i} \right)^2 - (2\log 2-1) \left( \log \frac{C_i}{O_i} \right)^2 \right] }. $$

I think this code is fairly self-explanatory but what's what?

`Z =` Number of closing prices in a year, `n =` number of historical prices used for the volatility estimate.

* $\LaTeX$ taken from the vignette.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.