Skip to content

हिंदी में पढ़ें

Calculating Historical Volatility

In the previous chapter you learned that volatility measures the size of price moves and is written as a yearly percentage. But where does a number like "Nifty volatility is 13%" come from? In this chapter you will calculate it yourself from closing prices, one column at a time, exactly as you would in a spreadsheet. Once you have done it by hand, the number will never feel like magic again.

Video: Calculating Historical Volatility (3:10)

What you will learn

  • What historical volatility (HV) is and what data you need
  • How to calculate daily returns, including log returns
  • How to find the standard deviation of returns, step by step
  • How to annualise it with the square root of 252
  • How to do the whole calculation with three spreadsheet formulas
  • How the lookback period changes the answer, and how to compare stocks
  • The limits of historical volatility

What is historical volatility?

Historical volatility (HV) is the volatility of an underlying calculated from its past prices. It answers one question: "How much did this price actually move, on a typical day, over a past period?" The answer is written as an annual percentage, so that you can compare any two underlyings.

Historical volatility looks backwards. It tells you what happened, not what will happen. Later, in Implied Volatility, you will meet a volatility that looks forward. Comparing the two is one of the most useful things an option trader can do.

Definition

Historical volatility (HV) is the standard deviation of daily returns over a past period, converted to a yearly figure. It is also called statistical volatility. The number of past days used is called the lookback period, for example "20-day HV" or "1-year HV".

The data you need

You need only one thing: the closing price of each trading day for the period you want to study.

  • For Nifty or Bank Nifty, you can download daily closing values from the NSE website or copy them from your charting platform.
  • For a stock, use prices adjusted for splits and bonus issues (see corporate actions). For example, HDFC Bank's share price became much lower after its 2025 bonus issue. An unadjusted price series would show a huge one-day "fall" that never really happened, and your volatility would be wrong.

We use closing prices because they are the official prices of each day and are easy to find. Using the same time each day (the close) also keeps the measurement fair.

The example data

Here are 11 example closing prices of Nifty, from 16 October to 2 November 2026. (These are illustration values, not real history.) Note that 20 October 2026 is a trading holiday, so it is not in the list.

Line chart of 11 example Nifty closing prices from 16 October to 2 November 2026, moving between 22,740 and 23,210 and ending at 23,000

The prices move between 22,740 and 23,210. Our job is to turn this list of prices into one volatility number. We do it in six steps.

Step 1: Calculate the daily returns

Volatility is about the size of moves in percentage terms, not in points. A 100-point move is big for a ₹1,000 stock but tiny for Nifty at 23,000. So we first turn prices into daily returns.

The simplest daily return is the percentage change:

Daily return = (Today's close ÷ Yesterday's close) - 1

For 19 October: (22,920 ÷ 22,740) - 1 = 0.00792, or +0.792%.

Professionals use a slightly different version called the log return:

Log return = ln(Today's close ÷ Yesterday's close)

Here, "ln" means the natural logarithm. You do not need to calculate it by hand. Every spreadsheet has an LN function, and every scientific calculator has an ln button.

For 19 October: ln(22,920 ÷ 22,740) = ln(1.007916) = 0.00788, or +0.788%.

Why use log returns? For small daily moves, the log return and the percentage change are almost the same (+0.788% vs +0.792% here). But log returns have one very handy property: they add up correctly over many days. The sum of all the daily log returns equals the log return of the whole period. We use this as a check below. This is also the method that most data providers and the option pricing models use.

Here are all ten daily returns. Eleven prices give ten returns, because the first day has no "yesterday" in our list.

Date Nifty close Daily log return
16 Oct 22,740 (no return for the first day)
19 Oct 22,920 +0.788%
21 Oct 22,790 -0.569%
22 Oct 22,980 +0.830%
23 Oct 23,170 +0.823%
26 Oct 22,990 -0.780%
27 Oct 22,840 -0.655%
28 Oct 23,050 +0.915%
29 Oct 23,210 +0.692%
30 Oct 22,930 -1.214%
2 Nov 23,000 +0.305%

Step 2: Find the average daily return

Add the ten returns and divide by 10.

Sum = 0.788 - 0.569 + 0.830 + 0.823 - 0.780 - 0.655 + 0.915 + 0.692 - 1.214 + 0.305 = +1.135%

If you keep all the decimals of each return, the exact sum is +1.137%. The small difference comes only from rounding each return to three decimals.

Average = 1.137 ÷ 10 = +0.114% per day (more exactly, 0.1137%).

Here is the check we promised. The total log return from the first price to the last is ln(23,000 ÷ 22,740) = ln(1.011434) = 0.01137, or +1.137%. That matches the sum of the daily returns exactly.

Step 3: Find how far each day is from the average, and square it

Volatility measures how much the daily returns spread out around their average. So for each day we find the difference between that day's return and the average. Then we square the difference (multiply it by itself).

Why square it?

  • Some differences are positive and some are negative. If we simply added them, they would cancel out to zero. Squaring makes every difference positive.
  • Squaring also gives more weight to big moves. A day that is 1.3% away from the average counts much more than a day that is 0.2% away. This fits our idea of risk: big surprises matter most.

Here is the full spreadsheet-style table.

Date Close Daily return (%) Return minus average Squared
16 Oct 22,740
19 Oct 22,920 +0.788 +0.675 0.4553
21 Oct 22,790 -0.569 -0.682 0.4658
22 Oct 22,980 +0.830 +0.717 0.5135
23 Oct 23,170 +0.823 +0.710 0.5037
26 Oct 22,990 -0.780 -0.894 0.7985
27 Oct 22,840 -0.655 -0.768 0.5903
28 Oct 23,050 +0.915 +0.802 0.6425
29 Oct 23,210 +0.692 +0.578 0.3342
30 Oct 22,930 -1.214 -1.327 1.7620
2 Nov 23,000 +0.305 +0.191 0.0365
Total +1.135 about 0 6.1023

Check one row yourself. On 30 October the return was -1.214%. The average is +0.1137%. So the difference is -1.214 - 0.1137 = -1.327 (rounded). Squared: 1.327 × 1.327 = 1.762.

Notice that the "Return minus average" column always adds up to zero (here 0.002, only because of rounding). That is a good check that you subtracted correctly.

Step 4: Calculate the variance

The variance is the average of the squared differences. There is one small twist: we divide by the number of returns minus one.

Variance = Sum of squared differences ÷ (Number of returns - 1)

Variance = 6.1023 ÷ (10 - 1) = 6.1023 ÷ 9 = 0.6780

Why divide by 9 and not 10? We already used the same ten returns to calculate the average. That uses up a little of the information in the data, so the spread would look slightly too small if we divided by 10. Dividing by one less is the standard correction for a sample of data. With many days of data, the difference becomes tiny.

Step 5: Take the square root to get the daily volatility

The variance is in "squared percent", which is hard to understand. Taking the square root brings it back to percent. The result is the standard deviation of daily returns.

Daily standard deviation = √0.6780 = 0.8234%

This is the daily volatility of Nifty in our example. It means that a typical daily move, up or down, was about 0.82%. With Nifty at 23,000, that is about 0.8234% × 23,000 = 189 points.

The chart below shows the ten returns with the average (dashed line) and a band of one standard deviation above and below the average.

Bar chart of the ten daily Nifty returns with the average of +0.114% as a dashed line and a shaded band from -0.710% to +0.937%, one standard deviation either side of the average

Most of the bars end inside or near the shaded band. One day, 30 October, falls well outside it. That single big day adds the most to the volatility (its squared value is 1.7620, the biggest in the table).

Step 6: Annualise with the square root of 252

Traders quote volatility per year, so we convert the daily figure to a yearly figure. As you learned in the previous chapter, moves grow with the square root of time. India has about 252 trading days in a year, so:

Annual volatility = Daily volatility × √252

√252 = 15.87

Annual volatility = 0.8234% × 15.87 = 13.07%

So the historical volatility of Nifty over these ten days is about 13.1% per year.

All six steps in one table

Step What you do Our example
1. Daily returns ln(Today's close ÷ Yesterday's close) for each day 10 returns from 11 prices
2. Average Sum of returns ÷ number of returns 1.137 ÷ 10 = +0.1137%
3. Squared differences (Return - Average)², then add them up Total = 6.1023
4. Variance Sum ÷ (number of returns - 1) 6.1023 ÷ 9 = 0.6780
5. Daily volatility √Variance √0.6780 = 0.8234%
6. Annual volatility Daily volatility × √252 0.8234% × 15.87 = 13.07%

The formula

Here is the same calculation written as one formula.

\[ \sigma_{\text{annual}} = \sqrt{252} \times \sqrt{\frac{\sum_{i=1}^{n} (r_i - \bar{r})^2}{n - 1}} \]

In plain English:

  • \(r_i\) is the return of day number \(i\), and \(\bar{r}\) (read "r bar") is the average return.
  • \((r_i - \bar{r})^2\) is the squared difference of each day from the average.
  • The big \(\sum\) sign means "add them all up", and dividing by \(n - 1\) gives the variance.
  • The inner square root turns the variance into the daily standard deviation.
  • Multiplying by \(\sqrt{252}\) turns the daily figure into a yearly figure.
  • The Greek letter \(\sigma\) (sigma) is the usual symbol for volatility.

Doing it in a spreadsheet

You do not need to do the six steps by hand every time. A spreadsheet does it with three formulas. Put the dates in column A and the closing prices in column B.

  1. In cell C3, type =LN(B3/B2) and copy it down to the last row. This gives the daily log returns.
  2. Below the returns, type =STDEV.S(C3:C12). This gives the daily standard deviation in one step (steps 2 to 5 together).
  3. In the next cell, type =C14*SQRT(252) to annualise. Format the cell as a percentage.

Spreadsheet showing Nifty dates and closes in columns A and B, daily log returns in column C with the formula =LN(B3/B2), daily standard deviation 0.00823 from =STDEV.S(C3:C12) and annual HV 13.07% from =C14*SQRT(252)

These formulas work in both Excel and Google Sheets. The spreadsheet gives exactly the same 13.07% that we calculated by hand.

STDEV.S, not STDEV.P

Spreadsheets have two standard deviation functions. STDEV.S divides by n - 1 (a sample), which is what we want. STDEV.P divides by n (a whole population). With 10 returns, STDEV.P would give a slightly smaller answer (about 12.4% instead of 13.07%). With 250 returns, the two are almost the same.

Annualising with other data frequencies

The number inside the square root is the number of periods in a year. If you use daily data, it is 252. If you use other data, it changes:

Data you use Periods in a year Multiply the period's standard deviation by
Daily closes 252 trading days √252 = 15.87
Weekly closes 52 weeks √52 = 7.21
Monthly closes 12 months √12 = 3.46

Some sources use 250 or 256 instead of 252. The answer changes only a little. Just be consistent: always use the same number when you compare two underlyings.

Choosing the lookback period

How many days of data should you use? There is no single right answer. Different lookback periods answer different questions.

Lookback period What it shows Good for
10 days The very latest behaviour Short-term trades; reacts fast, but jumps around
20 days (about one month) Recent behaviour Weekly and monthly options; the most common choice
60 days (about three months) Medium-term behaviour Monthly options, smoothing out one-off days
252 days (one year) Long-term normal level Knowing what is "normal" for this underlying

A short window reacts quickly to new conditions but is easily distorted by one big day. A long window is stable but slow to notice that the market has changed.

The chart below shows an example of one year of Nifty prices, with the 20-day historical volatility in the lower panel. Each point of the purple line is the HV of the 20 trading days before that date.

Nifty daily chart (example) for one year with the 20-day historical volatility in the lower panel, staying near 7% to 13% in calm months, rising to about 25% during a volatile stretch and falling back to about 9.6%

In this example, the 20-day HV stays between about 7% and 13% in the calm months. It rises to about 25% during the volatile stretch in the middle of the year. Then it slowly falls back to about 9.6% at the end.

Now see how the lookback period changes the answer on the last day of the same example:

Lookback period Historical volatility on the last day
10 days 8.6%
20 days 9.6%
60 days 11.1%
120 days 15.9%
1 year 13.3%

The same Nifty, on the same day, has an HV anywhere from 8.6% to 15.9%, depending only on the window. The 120-day figure is the highest because it still includes the volatile stretch. The short windows show that the market has calmed down recently.

So whenever you see an HV number, ask: "Over how many days?"

Comparing the volatility of different underlyings

Because HV is a percentage, you can compare any two underlyings, whatever their price. The chart below shows the 1-year HV of Nifty and four example stocks. These are example values to show typical differences, not the volatility of any real company.

Horizontal bar chart of 1-year historical volatility: Nifty 50 12.9%, an FMCG stock 17.1%, a private bank stock 22.7%, an IT stock 24.9% and a midcap stock 44.0%, with the matching daily moves

Underlying (example) Annual HV Daily volatility (÷ 15.87)
Nifty 50 12.9% about 0.81%
FMCG stock 17.1% about 1.08%
Private bank stock 22.7% about 1.43%
IT stock 24.9% about 1.57%
Midcap stock 44.0% about 2.77%

What this tells an option trader:

  • The midcap stock moves more than three times as much as Nifty on a typical day. Its options will be much more expensive, in percentage terms, than Nifty options.
  • A stop loss of 1% may be sensible for Nifty but is just normal noise for the midcap stock. It would be hit almost every day.
  • The same view ("I expect a 3% rise in two weeks") is a big move for Nifty and a small one for the midcap stock.

How option traders use historical volatility

Historical volatility is a starting point, not the final answer. Here are its main uses.

  1. To judge if options are cheap or expensive. Compare the HV with the implied volatility (IV) in the option prices. If Nifty's recent HV is 10% and option IV is 18%, options are pricing in much bigger moves than Nifty has been making. We study this in Implied Volatility and Realised vs Implied Volatility.
  2. To estimate likely price ranges. With HV you can estimate how far the price may move in a day, a week or a month. That is the topic of the next chapter.
  3. To set stop losses and position sizes. A volatile stock needs a wider stop and a smaller position for the same rupee risk. We cover this in Position Sizing for Options.
  4. To compare underlyings. It tells you which stocks are calm and which are wild, before you look at their options.

Limits of historical volatility

Historical volatility is useful, but you must know its weaknesses.

  • It looks backwards. A calm past does not promise a calm future. A company result, a Budget or an RBI policy can change everything in one day (see Events and IV Crush).
  • It depends on the window. As you saw, the same underlying can show 8.6% or 15.9% depending on the lookback period.
  • One big day can dominate. In our ten-day example, one day (30 October) made up almost 29% of the total squared differences (1.7620 out of 6.1023).
  • Close-to-close misses what happens during the day. If Nifty falls 2% in the morning and recovers by the close, the close-to-close return shows almost nothing. Some traders use methods based on the day's high and low to capture this, but close-to-close is the standard.
  • Corporate actions can spoil the data. Always use prices adjusted for splits, bonus issues and large special dividends.

Common mistakes when calculating HV

  • Calculating the standard deviation of prices instead of returns. This gives a meaningless number in rupees or points.
  • Forgetting to annualise, and then comparing a daily 0.82% with an option IV of 13%.
  • Mixing 252 and 365. For daily trading data, use 252 trading days.
  • Using unadjusted stock prices across a split or bonus issue.

What comes next

You can now turn any list of closing prices into a volatility number. In the next chapter, Normal Distribution and Price Ranges, we use that number to answer a practical question. How far is Nifty likely to move in a day, a week or a month?

Key takeaways

  • Historical volatility (HV) is the standard deviation of past daily returns, converted to a yearly percentage.
  • Use daily log returns: ln(Today's close ÷ Yesterday's close); for small moves they are almost the same as percentage changes.
  • The steps are: returns, average, squared differences, variance (divide by n - 1), square root, then multiply by √252.
  • In a spreadsheet: =LN(B3/B2), then =STDEV.S(...), then ×SQRT(252).
  • In our example, a daily volatility of 0.8234% gives an annual HV of 0.8234% × 15.87 = 13.07%.
  • The lookback period matters: always ask "HV over how many days?"
  • HV looks backwards; compare it with implied volatility to judge whether options are cheap or expensive.

Check your understanding

  1. Why do we calculate volatility from daily returns and not from daily prices?
  2. A stock's daily standard deviation of returns is 1.2%. What is its annual historical volatility?
  3. A stock has an annual historical volatility of 20%. What is its typical daily move?
  4. A share closes at ₹1,000, ₹1,020, ₹1,010 and ₹1,030 on four days in a row. The three log returns are +1.980%, -0.985% and +1.961%. Calculate the annual historical volatility.
  5. A trader says, "Nifty HV is 9%." Another says, "Nifty HV is 16%." How can both be right on the same day?
Show answers
  1. Volatility measures moves in percentage terms, so that underlyings at different prices can be compared. The standard deviation of prices would be in rupees or points and would depend on the price level and the trend, not on the size of daily moves.
  2. 1.2% × √252 = 1.2% × 15.87 = about 19.0%.
  3. 20% ÷ √252 = 20% ÷ 15.87 = about 1.26% per day.
  4. Average = (1.980 - 0.985 + 1.961) ÷ 3 = 2.956 ÷ 3 = 0.985%. Differences from the average: +0.995, -1.971 and +0.976. Squares: 0.990, 3.883 and 0.952; total 5.825. Variance = 5.825 ÷ (3 - 1) = 2.912. Daily volatility = √2.912 = 1.707%. Annual HV = 1.707% × 15.87 = about 27.1%. (With only three returns this is a very rough estimate.)
  5. They are probably using different lookback periods. A short window such as 10 or 20 days may show 9% after a calm month. A longer window such as 120 days or a year may still include an earlier volatile period and show 16%.

Test yourself

Take the quiz for this chapter: 14 multiple choice questions, each with an explanation.

Let's Check Your Knowledge of Historical Volatility