Historical volatility is defined as the standard deviation of bar-to-bar price change expressed as an annualized percentage. It is used to see how much prices change over some period of time.
The calculation is performed as follows:
Assume a 10 bar historical volatility.
First, for each of the last 9 bars and the current bar, divide the bar’s close by the previous bar’s close. Find the logarithm of this value.
Next, add all of the above logarithmic values together and divide by 10 (the number of bars we’re considering for the historical volatility) to get the logarithmic mean.
Now, for each of the last 9 bars and the current bar, once again divide the bar’s close by the previous bar’s close. Find the logarithm of this value, subtract the above calculated logarithmic mean, and square this value.
Add all of the above values together, divide by 9, and get the square root of this value. Multiple by one of the following values:
If using a daily time period, multiply by 15.81139 which is the square root of 250.0, roughly the number of trading days in year. If using a weekly time period, multiply by 7.211102 which is the square root of 52.0, the number of weeks in year. If using a monthly time period, multiply by 3.464102 which is the square root of 12, the number of months in year.
Finally, multiply this value by 100 to get the historical volatility.
Reference: Conners, Laurence A., and Blake E Hayward. Investment Secrets of a Hedge Fund Manager. Chicago, Illinois: Probus Publishing Company, 1995.