Historical volatility: how to calculate it, with a worked example

By Caio Marchesani · 10 December 2024

In the previous post I described historical volatility in general terms, as a measure of how much an asset’s price has moved around in the past. This one is about actually calculating it, which comes down to taking the standard deviation of returns and scaling it. The arithmetic is simple. The decisions around the arithmetic, which returns to use, over what period, at what frequency, are where people go wrong, so I have spent as much time on those as on the formula.

Line chart of rolling 13-week annualised historical volatility for Bitcoin, the S&P 500 and gold, November 2021 to November 2026

What the number is

Historical volatility is the standard deviation of an asset’s returns over some past window, usually quoted as an annualised percentage. A stock with 20 per cent historical volatility has, roughly speaking, moved up or down by about 20 per cent over a year in a typical year. In trading it gets used at every frequency, including hourly, but the annualised daily version is the one you will see quoted and the one I will work through here. It feeds into option pricing, into position sizing, and into any honest attempt to say how much a holding might move against you.

Standard deviation is the natural tool because it measures exactly the thing we care about, which is how widely the returns are spread around their average. A tight spread means a calm asset; a wide one means large swings in both directions.

The data

You need a series of prices. Yahoo Finance will give you daily data for most things for free, and it comes in the usual OHLC format, meaning open, high, low and close for each day. For this calculation you use the close. Most people work with daily closes; you can do the same thing with weekly or monthly prices, or with intraday bars, depending on the horizon you trade.

To keep the example small, suppose you have ten days of closing prices:

Day Close (£)
1 100
2 102
3 101
4 103
5 105
6 107
7 110
8 108
9 109
10 111

Step one: returns

Volatility is calculated on returns, not on prices. The return on day t is the log of today’s price over yesterday’s:

\[R_t = \ln\left(\frac{P_t}{P_{t-1}}\right)\]

You could use simple percentage changes instead, and over short periods the two are almost identical. I use log returns out of habit and for three practical reasons. They add up across time, so a week’s return is just the sum of five daily ones. They treat a rise and a fall symmetrically, where a simple 10 per cent gain followed by a 10 per cent loss does not get you back to where you started. And they are what the standard models, Black-Scholes included, assume, because a price that follows geometric Brownian motion has log returns that are normally distributed.

For the ten prices above that gives nine returns, in percent: 1.98, -0.99, 1.96, 1.92, 1.89, 2.77, -1.84, 0.92 and 1.82.

Step two: the mean

\[\mu = \frac{\sum_{t=1}^{n} R_t}{n}\]

where n is the number of returns, nine here. The mean comes out at about 1.16 per cent a day, which is very high and reflects the fact that I picked a series that climbs 11 per cent in ten days to keep the numbers readable. Over any realistic window the mean daily return is close to zero and some people leave it out of the calculation altogether. It makes almost no difference to the result.

Step three: the standard deviation

\[\sigma = \sqrt{\frac{\sum_{t=1}^{n} (R_t – \mu)^2}{n – 1}}\]

The n minus 1 in the denominator is the usual sample correction, and matters when the sample is as small as nine. For our returns the standard deviation is about 1.54 per cent per day.

Step four: annualise

A daily standard deviation is not comparable with anything else, so it is scaled to a year by multiplying by the square root of the number of trading days:

\[HV = \sigma \times \sqrt{252}\]

The square root is there because variance adds across independent periods, so standard deviation grows with the square root of time. There are about 252 trading days in a year for equities. For crypto, which trades every day, use 365. For our example, 1.54 per cent times the square root of 252 is about 24.5 per cent, and that is the annualised historical volatility of the series.

In practice you would do this on a few hundred prices rather than ten, and in a spreadsheet or in a few lines of pandas rather than by hand. But the ten-day version shows every moving part, and once you have done it once the spreadsheet version is obvious.

The decisions that actually matter

The window. Thirty days of daily returns tells you about the recent regime and is sensitive to a single bad week. A year of daily returns is smoother and slower to notice that something has changed. There is no right answer, only a right answer for a particular purpose, and in practice I look at both.

The frequency. Daily returns are the default and the right choice for most purposes. Weekly or monthly returns give you fewer data points and a smoother picture, which is fine for long-horizon decisions and useless for a position you intend to hold for a fortnight.

The assumption that the past is a guide. Historical volatility describes what happened. It does not know about next week’s central bank meeting or a change in the rules of the market. It is most useful when combined with implied volatility, which is the market’s forward-looking estimate, and I compare the two in the next post in this series.

The distribution. Using log returns amounts to assuming that prices are log-normally distributed, which is the assumption underneath Black-Scholes. A log-normal distribution has a sharper peak than a normal one and a fatter right tail, which fits financial prices better: prices cannot go below zero, and large upward moves happen more often than a bell curve would suggest. It still underestimates how often extreme moves happen in either direction. No simple distribution captures that, and anyone running a risk model should be aware that the tails are thinner in the model than in the market.

The market. Volatility is a different animal in different places. Equities move more than government bonds, cryptocurrencies move far more than equities, and emerging markets carry risks that a price series does not show. Historical volatility is a fair starting point in all of them and a complete answer in none, which is why it belongs alongside other measures, such as implied volatility, beta, and some form of value at risk, rather than on its own.

Related articles

About the author

Caio Marchesani is a hedge fund manager, trader and engineer, with an MEng in Mechanical Engineering from University College London and more than fifteen years applying quantitative models to energy and macro markets, including as founder of a London quantitative macro energy fund. He also invests in and builds businesses outside finance, and founded Acai Berry Foods, the açaí café brand that began on Brick Lane and now has shops in London, the UAE and New York.

Read the full biography

Scroll to Top