A common and well-known way to estimate historical volatility of a financial instrument is by calculating the standard deviation of each period in the sample. Although the standard deviation is a popular measure of the volatility of an instrument, it is not the sole one. Several different calculation methods exist to estimate the historical volatility of a financial instrument.
This function uses the Parkinson formula, named after physicist Michael Parkinson, to estimate historical volatility of an underlying. Contrary to the standard deviation formula, which uses only the security close price in its calculation, the Parkinson formula uses the high and low prices but do not use the close price. No method is better than the other and each one has its advantages and disadvantages.
Function parameters:
Lookback: the number of lookback period to use to estimate the security historical volatility.
NB: The Parkinson formula is a better measure of volatility than the standard deviation for illiquid markets.
Several historical volatility formulas can be used and combinated to get a better measure of a security volatility.
The security returns should follow a geometric random walk.