The calculator above takes a column of closing prices, works out the daily log returns, measures how widely they spread, and turns that into a yearly figure and an expected move for the days ahead. This page explains each step, shows the calculator's own sample worked through by hand, compares close-to-close volatility with estimators that use the day's high and low, and shows how traders in India use the result on Nifty, Bank Nifty and stocks. Volatility describes the size of past moves, not their direction, and it does not forecast what happens next.
What the historical volatility calculator does
| Part | What it does |
|---|---|
| Input | Closing prices, oldest first: a day, a week or any equal spacing |
| Returns | Log returns, ln(today's close ÷ previous close) |
| Daily volatility | The sample standard deviation of those returns |
| Annualised volatility | Daily volatility × √252 |
| Expected move | One standard deviation from the last close, for the number of days you choose |
| Range table | The one standard deviation range for 1, 5, 10 and 21 trading days |
| Minimum data | Three closes; twenty or more give a figure worth using |
A short history of measuring volatility
The idea that prices move by random steps whose size can be measured goes back to 1900, when Louis Bachelier, a French student, modelled the Paris bond market in his thesis. For half a century the work was mostly forgotten.1 In 1952 Harry Markowitz made the variance of returns, the square of volatility, the measure of risk at the centre of portfolio theory.2
Volatility became a traded number in 1973, when Fischer Black and Myron Scholes published their option pricing formula. Every input to the formula can be observed except one: the volatility of the underlying. Traders started estimating it from past prices, which is historical volatility, and working it backwards from option prices, which is implied volatility.3
In 1980 Michael Parkinson, and separately Mark Garman and Michael Klass, showed that the day's high and low carry more information about volatility than the close alone, so the same number of days gives a more precise estimate.45 Later estimators by Rogers and Satchell (1991) and Yang and Zhang (2000) dealt with drift and with overnight gaps.6 In 1994 J.P. Morgan's RiskMetrics made an exponentially weighted volatility, which gives recent days more weight, the standard for banks' risk reports.7
In India, the NSE launched India VIX in 2008, a measure of the volatility expected over the next thirty days, calculated from Nifty option prices.8 It gave traders a daily reference point for implied volatility to set beside the historical figure they could calculate themselves.
How historical volatility is calculated
- Collect closing prices for the period, such as the last 21 trading days, which is about a month.
- Calculate daily returns. The usual choice is the log return: ln(today's close ÷ yesterday's close). Twenty-one closes give twenty returns.
- Find the average return over the period.
- Calculate the standard deviation: for each return, subtract the average and square the result; add the squares, divide by the number of returns minus one, and take the square root.
- Annualise by multiplying by the square root of the number of trading days in a year, about 252.
The calculator does exactly these steps. Dividing by the number of returns minus one, not by the number of returns, is the usual sample correction; with twenty returns it raises the figure by about 2.6%.
Why log returns
A log return of a 10% rise followed by a 10% fall shows the true result: you end below where you started. Log returns also add up over time, so the return over five days is the sum of the five daily log returns. For daily moves of one or two per cent, log returns and simple percentage returns differ only in the second decimal place, and either gives almost the same volatility.
Why √252
Volatility grows with the square root of time when daily returns are independent of each other. Variance, the square of volatility, adds up day by day, so a year of 252 trading days has 252 times the daily variance and √252 ≈ 15.87 times the daily volatility. Indian exchanges trade about 248 to 252 days a year depending on holidays; the difference between √248 and √252 is under 1%. Some option models use calendar days and √365 instead; what matters is that you use the same convention for the figures you compare.9
A worked example: the calculator's sample
The calculator opens with 21 sample closes for an index, from 25,000 to 25,480, and 5 days ahead for the expected move. Working through them gives:
| Measure | Value |
|---|---|
| Returns used | 20, from 21 closes |
| Daily volatility | 0.64% |
| Annualised volatility | 10.21% (0.64% × 15.87) |
| Last close | 25,480 |
| Expected move, 5 days | ±366 points, from 25,114 to 25,846 |
The full range table from the same closes:
| Trading days | One standard deviation move | Low | High |
|---|---|---|---|
| 1 | ±164 | 25,316 | 25,644 |
| 5 | ±366 | 25,114 | 25,846 |
| 10 | ±518 | 24,962 | 25,998 |
| 21 | ±751 | 24,729 | 26,231 |
The move for 5 days is not five times the move for one day, but √5 ≈ 2.24 times it, because good and bad days partly cancel. If returns were normally distributed, about two closes in three would fall inside the one standard deviation range and about nineteen in twenty inside twice that range. Real markets have more large days than the normal curve expects, so treat the outer range as a rough guide, not a limit.
A worked example by hand
Take six closes of a stock: ₹1,500, ₹1,518, ₹1,509, ₹1,527, ₹1,512 and ₹1,530.
| Day | Close | Log return |
|---|---|---|
| 1 | ₹1,500 | — |
| 2 | ₹1,518 | +1.193% |
| 3 | ₹1,509 | −0.595% |
| 4 | ₹1,527 | +1.186% |
| 5 | ₹1,512 | −0.987% |
| 6 | ₹1,530 | +1.183% |
The average of the five returns is +0.396%. The sample standard deviation is 1.09% a day, and the annualised volatility is 1.09% × 15.87 ≈ 17.3%. Five returns are far too few for a figure you would trade on, but the steps are the same with a hundred.
Choosing the window
| Window | About | Behaviour |
|---|---|---|
| 10 days | Two weeks | Very responsive, noisy |
| 20 to 21 days | A month | A common default |
| 60 days | Three months | Smoother, slower |
| 252 days | A year | Stable, slow to react |
A short window reacts quickly to new conditions but jumps around. A long window is stable but slow. Comparing two windows, such as 10-day and 60-day HV, shows whether volatility is rising or falling: a 10-day figure well above the 60-day figure means the market has become more active recently.
Traders who follow volatility closely draw a volatility cone: for each window length, the highest, lowest and middle HV over the past year or two. Today's figure can then be read as high, low or normal for that window, which is more useful than any fixed number.
Gaps, events and how one day changes the figure
A single large move has an outsized effect on short windows. Take a stock that moves 0.8% up or down each day for twenty days. Its daily volatility is 0.82% and its annualised volatility 13.0%. Replace the last day with a 4% gap after a results announcement, and the twenty-day figure jumps to 1.21% a day, or 19.1% a year, almost half as much again, from one day.
In the Indian market, the days that do this are predictable in kind if not in size: company results, the Union Budget, the RBI's policy announcements, election results and global events overnight. Weekly expiry days add their own pattern of intraday movement in the index. When you compare HV across periods, check whether one window contains such an event and the other does not.
Weighting recent days more: exponentially weighted volatility
The calculator gives every day in the window the same weight, so a big day counts fully until the moment it drops out, and then the figure falls in one step. An exponentially weighted figure avoids that jump. Each day's squared return gets a weight that shrinks the further back it lies, so recent days count most and old days fade out gradually.
RiskMetrics used a decay factor of 0.94 for daily data: yesterday's squared return gets a weight of 6%, the day before 5.6%, and so on.7 The result reacts quickly to a new burst of movement and settles down smoothly after it. Many risk systems use this kind of figure; the plain equal-weight calculation on this page is easier to check by hand and is what most charting tools show.
An index and its stocks
An index is usually less volatile than most of the stocks in it, because the stocks do not all move together on the same day: one stock's fall is partly offset by another's rise. Nifty's historical volatility is therefore normally well below that of the average Nifty stock. A sector index such as Bank Nifty, whose stocks move together more closely, tends to be more volatile than the broad index, and small and mid-sized companies more volatile still.
The same effect explains why a portfolio of several unrelated stocks swings less than any one of them. It does not remove risk on the days when everything falls together, which are the days when correlations between stocks rise towards one.
Close-to-close and range-based estimators
The close-to-close method ignores everything between one close and the next. A day that swings 2% and closes unchanged counts as a quiet day. Range-based estimators use more of each day's information:
| Estimator | Uses | Strength | Weakness |
|---|---|---|---|
| Close-to-close | Close | Simple, what most tools show | Ignores intraday moves |
| Parkinson | High and low | Several times more efficient on the same days | Ignores gaps and drift |
| Garman–Klass | Open, high, low, close | More efficient still | Ignores overnight gaps |
| Rogers–Satchell | Open, high, low, close | Allows for drift | Ignores gaps |
| Yang–Zhang | Open, high, low, close and the previous close | Handles gaps and drift | More complex |
The Parkinson estimator for one day is (ln(high ÷ low))² ÷ (4 × ln 2). For a Nifty day with a high of 25,620 and a low of 25,380, that gives a daily volatility of about 0.57%. On a day that gaps and then drifts, range estimators can understate volatility, which is why Yang–Zhang adds the overnight return.
The calculator uses close-to-close because closing prices are what every trader has. If you have daily highs and lows, a range estimator over the same window gives a steadier figure.
Historical vs implied volatility
| Historical volatility | Implied volatility | |
|---|---|---|
| What it measures | How much the price did move | How much the market expects it to move |
| Source | Past prices | Current option prices |
| Looks | Backward | Forward |
| Index measure | Your own calculation | India VIX for Nifty |
When implied volatility is well above recent historical volatility, options are priced for more movement than the market has recently shown. When implied volatility is below historical volatility, options look cheap relative to recent movement. Neither tells you what happens next: implied volatility often rises before known events such as results or the Budget, and the event may justify it. Use the implied volatility calculator to find the volatility in a given option price.
India VIX measures expected Nifty volatility over thirty calendar days. It has moved from below 10 in very quiet periods to above 80 in late 2008 and again in March 2020. Historical Nifty volatility tends to move in the same direction as India VIX but sits below it most of the time, because option prices usually carry a premium for the risk of a large move.
A worked example: comparing HV with IV on Nifty
Use the calculator's sample: Nifty at 25,480 with 21-day historical volatility of 10.21%. Suppose the at-the-money options for the next expiry imply 13%.
| Measure | From HV 10.21% | From IV 13% |
|---|---|---|
| One standard deviation move, 5 trading days | ±366 points | ±467 points |
| One standard deviation move, 21 trading days | ±751 points | ±956 points |
The options are priced for moves about 27% larger than the index has recently made. An option seller may read that as a cushion; an option buyer may read it as paying up for movement that has not been happening. Both readings leave out what the market may know: a scheduled event, a global risk, a change in liquidity. Compare the gap with its own history before you act on it, and remember that the figures change every day.
A worked example: sizing two stocks by volatility
Suppose you want a one standard deviation daily move in each position to be worth about ₹2,000.
| Stock | Price | Daily volatility | Move per share | Shares | Position value |
|---|---|---|---|---|---|
| A | ₹1,500 | 1.2% | ₹18 | 111 | ₹1,66,500 |
| B | ₹800 | 2.5% | ₹20 | 100 | ₹80,000 |
Stock B gets half the money of stock A because it moves about twice as much in percentage terms. Sizing by volatility keeps each position's typical daily swing similar, so one volatile stock does not dominate the account. The position size calculator works the same idea from a stop-loss distance.
From volatility to a loss in rupees
Volatility in per cent becomes a rupee figure once you multiply by the size of the position. A ₹5 lakh holding in a stock with 1.5% daily volatility has a one standard deviation daily move of about ₹7,500. Over a week of five trading days the one standard deviation move is √5 times that, about ₹16,800.
This is the step that Value at Risk takes further: it picks a confidence level, such as 95% or 99%, and turns the volatility into the loss that should be exceeded only on one day in twenty or one in a hundred. The arithmetic is the same multiplication with a larger factor: about 1.65 standard deviations for 95% and 2.33 for 99%. On the ₹5 lakh holding above, that gives a one-day 95% figure of about ₹12,400 and a 99% figure of about ₹17,500.
Two cautions go with any such figure. It assumes the next days will look like the window you measured, and it assumes moves follow the normal curve. Markets break both assumptions in exactly the weeks when the figure matters most.
A worked example: volatility before and after results
Take a stock that has moved quietly for a month, with 20-day historical volatility of 18%. Its results are due next week, and the option prices imply 32% for the expiry just after the announcement.
| Point in time | 20-day HV | Implied volatility |
|---|---|---|
| A week before results | 18% | 32% |
| The day after results, on a 6% move | about 33% | about 22% |
| A month after results | back near 20% | near 20% |
The historical figure jumps the day after the announcement because one 6% day enters the window. The implied figure falls at the same time, because the uncertainty the options were pricing is over. The two measures cross: the historical one rises on the event that the implied one was waiting for. Twenty trading days later the event day leaves the window and the historical figure falls back.
The lesson is to read HV and IV around a known event with the calendar in front of you. A high historical figure right after results is often the echo of one day, not a sign of a more active stock.
Volatility for different holding periods
The same stock has different volatilities depending on the interval you measure.
- Intraday. Five-minute returns, scaled up, usually give a higher figure than daily closes, because prices wander during the day and partly come back by the close.
- Daily. The standard figure, and the one the calculator produces.
- Weekly and monthly. Often close to the daily figure scaled by the square-root rule, but lower in markets that tend to reverse and higher in markets that trend.
A scalper cares about intraday movement, a swing trader about daily and weekly, and an investor about monthly and yearly. Measure volatility on the interval that matches how long you hold a position, and scale it with the square-root rule only as a first approximation.
Reading historical volatility as an option buyer or seller
Option prices depend on implied volatility, but the profit or loss on a position held to expiry depends on the volatility that actually happens. That is why traders watch both.
- An option seller collects a premium set by implied volatility and loses when the realised movement is larger than the premium covers. A seller watches for short-window HV rising towards or above implied volatility, which means the market is moving more than the options were priced for.
- An option buyer pays a premium set by implied volatility and gains only when the movement is larger than the premium. A buyer watches for implied volatility that is low against the stock's own history, because cheap options need less movement to pay off.
- Both need to remember that time decay works daily and movement does not. A seller can be right about volatility over a month and still face a large loss in one week.
HV is the measured side of this comparison. It is a record of what happened, which is the only part of the comparison you can calculate exactly.
Using historical volatility in trading
- Position sizing: size positions inversely to volatility, as in the example above.
- Stops: set stops wider in volatile periods and tighter in quiet ones, or use a multiple of the average true range. See the ATR volatility strategy.
- Strategy filters: some traders run breakout rules only when short-window volatility is rising, and mean-reversion rules when it is low and stable. Test any such filter before you trust it.
- Option pricing: HV is a starting point for the volatility input in the Black-Scholes calculator, and a reference against which to read implied volatility.
- Comparing instruments: rank stocks or indices by HV to see which ones typically move more.
- Reading a backtest: a strategy tested only in a low-volatility year has not met a high-volatility market. Check the HV of the test period against the years around it.
Historical volatility in QuantPower
- On the chart. Arth.live charts, inside QuantPower and free for everyone, include a Historical Volatility indicator in its own pane, with a default period of 20. It shows the per-bar figure, not annualised: multiply by √252 for daily bars to compare with the calculator. Beside it are the Average True Range, Bollinger Bands and Bollinger Bandwidth, Keltner Channels, Standard Deviation, Chaikin Volatility and the Ulcer Index.
- On the option chain. Implied volatility and the Greeks for every strike, and the expected move from the at-the-money straddle, so you can set implied volatility beside the historical figure.
- In rules. Signal algos and scans can use any chart indicator in their conditions, so a rule such as "only when 10-day HV is above 60-day HV" can be written and tested.
- In testing. Backtests and Forward test show how a rule behaved in periods of high and low volatility before it trades with real money.
Charts, the option chain, the scanner and the strategy builder are free. A backtest costs 2 tokens after 10 free each week, and a live algo 200 tokens per 28 days (1 token = ₹1, GST extra).
How to use the calculator, step by step
- Copy closing prices for the stock or index, oldest first, from your chart's data export or a price history page.
- Paste them into the box, separated by commas or new lines. Twenty-one closes give a one-month figure.
- Set the days ahead for the expected move: 1 for tomorrow, 5 for a week, 21 for a month.
- Read the daily and annualised figures and the returns used, to check that every close was read.
- Read the range table to see the one standard deviation move for several horizons.
- Repeat with a longer window, such as 60 closes, and compare. A short-window figure well above the long one means volatility is rising.
Common mistakes
- Mixing intervals. Weekly closes need √52, not √252. The calculator's √252 assumes daily closes.
- Too few closes. Five or ten returns give a figure that can be half or double the true one.
- Including a split or bonus without adjusting. An unadjusted split looks like a 50% fall and makes the figure meaningless.
- Comparing different windows. A 10-day HV and a 60-day HV for two stocks do not compare.
- Reading volatility as direction. A high figure says moves were large, not which way they went.
- Treating one standard deviation as a limit. Moves of two and three standard deviations happen more often than the normal curve suggests.
Limits of historical volatility
- The past is not the future. Volatility changes, often suddenly, and clusters: quiet weeks tend to follow quiet weeks until they do not.
- It treats up and down moves the same. A strong rally raises HV just like a fall.
- Window choice changes the answer. Be consistent.
- Gaps and events can dominate short windows, as the example above shows.
- It assumes independent days. Trending markets and mean-reverting markets both break the square-root rule to some extent.
Where volatility measurement is going
Two directions are clear. The first is more data per day: intraday prices let traders calculate realised volatility from five-minute or one-minute returns, which gives a sharper daily figure than the close alone. The second is wider use of implied measures: exchanges publish volatility indices for more products, and option chains now show implied volatility and expected moves for every strike, so traders compare past and expected movement as a matter of routine. The basic calculation on this page stays the same underneath both.
Related guides
- Implied volatility crush: why option prices fall after an event
- India VIX report: what the volatility index shows and how traders read it
- VaR calculator: turning daily volatility into a loss estimate for a portfolio
Start with 500 free tokens
Connect your broker, build a strategy and test it on paper before a single live order goes out.
Frequently asked questions
How many closing prices do I need?
At least three for the calculator to work, but twenty-one or more for a figure worth using. A year of daily closes gives a stable long-run figure.
How do I annualise volatility from weekly closes?
Multiply the weekly standard deviation by √52. The calculator assumes daily closes and uses √252.
Why is my figure different from the one on another website?
The window, the return type (log or simple), the annualising factor (252, 250 or 365) and whether prices are adjusted for splits and dividends all change the result slightly.
Is historical volatility the same as India VIX?
No. India VIX measures expected Nifty volatility from option prices. Historical volatility measures past movement in the index.
Does high volatility mean the price will fall?
No. Volatility measures the size of moves in both directions. Falls are often more violent than rises, so volatility often rises in a fall, but a fast rally raises it too.
Can I see historical volatility on a QuantPower chart?
Yes. Add the Historical Volatility indicator; it shows the per-bar figure for the period you set, which you multiply by √252 on daily bars to annualise.
References
- Louis Bachelier, *Théorie de la spéculation*, Annales scientifiques de l'École Normale Supérieure (1900)
- Harry Markowitz, "Portfolio Selection", *Journal of Finance*, 7(1), 77–91 (1952)
- Fischer Black and Myron Scholes, "The Pricing of Options and Corporate Liabilities", *Journal of Political Economy*, 81(3), 637–654 (1973)
- Michael Parkinson, "The Extreme Value Method for Estimating the Variance of the Rate of Return", *Journal of Business*, 53(1), 61–65 (1980)
- Mark B. Garman and Michael J. Klass, "On the Estimation of Security Price Volatilities from Historical Data", *Journal of Business*, 53(1), 67–78 (1980)
- Dennis Yang and Qiang Zhang, "Drift-Independent Volatility Estimation Based on High, Low, Open, and Close Prices", *Journal of Business*, 73(3), 477–492 (2000)
- J.P. Morgan and Reuters, *RiskMetrics: Technical Document* (1994 and 1996 editions)
- NSE, India VIX: methodology and history (nseindia.com)
- John C. Hull, *Options, Futures, and Other Derivatives*, Pearson