Computing historical volatility

Course Name: Options Trading Strategies In Python: Basic, Section No: 3, Unit No: 8, Unit type: Notebook

Hi,

While calculating the historical volatility over a rolling window, why is it multiplied with np.sqrt(trading_days) ?

100*data['Log Returns'].rolling(window=20).std()*np.sqrt(20)

Why is this np.sqrt(20) used here ?

Thanks

To compare volatility across different timeframes, we annualize it by multiplying the standard deviation of returns by the square root of the number of trading days in a year. Usually, there are 252 trading days in a year. By annualizing the standard deviation, we can accurately compare the volatility of the two assets over a full year and this makes it easier to understand the potential risk and return of an asset.



Similarly, if we want to calculate the monthly historical volatility, we multiply by the square root of 20 (as we consider roughly 20 trading days in a month). Otherwise, we would measure the rolling standard deviation of log returns in daily volatility units. Multiplying by the square root of 20 scales it up to represent expected volatility over a month.



You can read more about Historical Volatility in the following blog:

https://blog.quantinsti.com/volatility-and-measures-of-risk-adjusted-return-based-on-volatility/