Lesson 6 of 15
Historical Volatility
Historical Volatility
Volatility is the standard deviation of returns. It is the most common measure of risk in finance.
Historical volatility is estimated from past price data using log returns:
- Compute log returns:
- Compute the sample standard deviation of these returns
- Annualize: multiply by (trading days per year)
Annualizing lets you compare volatility across assets regardless of how frequently the data is sampled.
Daily volatility (without annualization) is useful for short-term risk assessment.
Your Task
Implement:
hist_volatility_daily(prices)— sample std of log returns (daily)hist_volatility(prices)— annualized volatility (daily std × √252)
Python runtime loading...
Loading...
Click "Run" to execute your code.