Standard Deviation Indicator in Indian Markets: A Worked Nifty Example
Standard Deviation indicator for Nifty and Bank Nifty, with a fully worked example computing the exact SD value, expected move and F&O tax.
Key Takeaways
- 1.The Standard Deviation (SD) indicator measures how far price wanders from its own average. It is reported in rupees, the same unit as price, so a Nifty SD of 120 means roughly 120 points of typical day to day spread.
- 2.SD shows the size of moves, not the direction. A rising SD warns that swings are widening, which is information about risk, not a buy or sell signal by itself.
- 3.Bollinger Bands are literally SD made visual. The upper and lower bands sit at the 20 period moving average plus or minus 2 standard deviations, so mastering SD tells you exactly how wide those bands are.
- 4.In our fully worked Nifty example below the 20 day population standard deviation works out to exactly 605.53 points, and the sample (n minus 1) version to 621.06 points. The earlier version of this page never stated this final number, so here it is computed step by step.
- 5.For F&O traders SD feeds straight into expected move and option pricing. One SD covers about 68 percent of outcomes, so it helps you size positions, place stops and judge whether option premiums are rich or cheap.
What the Standard Deviation Indicator Actually Measures
The Standard Deviation indicator answers one precise question: on average, how far does the closing price sit away from its own moving average over the chosen lookback period? It is a pure measure of volatility, and crucially it is expressed in the same unit as the instrument itself. For Nifty it reads in index points, for Reliance it reads in rupees per share, and for Bank Nifty in points. A Nifty SD value of 120 does not mean 120 percent or 120 anything abstract. It means the typical distance between a day's close and the 20 day average close has been about 120 points.
Because SD is in price units, you can compare it directly to the instrument's price to get a feel for relative risk. A Nifty SD of 120 points on an index trading near 24,000 is roughly 0.5 percent, which is calm. The same 120 point SD on a single stock priced at 600 rupees would be 20 percent of price, which is wild. This is why traders often divide SD by price to get a percentage, or use the coefficient of variation, when comparing volatility across instruments of very different price levels.
The indicator is built on the closing price by default, though some platforms let you choose typical price (high plus low plus close divided by 3). Most Indian charting setups on Nifty and Bank Nifty default to a 20 period SD on closes, matching the 20 period basis of Bollinger Bands. Keep the data source consistent. If you compare SD across timeframes, make sure both use the same input price and the same period count, or the numbers are not comparable.
The Formula, and Why Population vs Sample Matters
Standard deviation is the square root of the variance. The recipe is five steps. First, find the mean (simple average) of the closing prices in the lookback window. Second, subtract the mean from each close to get the deviation. Third, square each deviation so positives and negatives do not cancel. Fourth, average those squared deviations. Fifth, take the square root. The result lands back in price units, which is what makes SD so readable on a chart.
There is one fork in the road that trips up most people, and it directly affects the final rupee number. In step four you can divide the sum of squared deviations either by n (the population formula) or by n minus 1 (the sample formula, also called Bessel's correction). Charting platforms almost universally use the population version, dividing by n, because they treat the lookback window as the complete data set. Spreadsheets are split: Excel STDEV.P and Google Sheets STDEVP use n, while STDEV.S and STDEV use n minus 1. For a 20 period window the two answers differ by a factor of the square root of 20 over 19, about 2.6 percent, so they will not match exactly. Always know which one your tool is using before you trust the number.
If your TradingView SD line and your Excel sheet disagree by a couple of percent, you are almost certainly mixing the population formula (divide by n) with the sample formula (divide by n minus 1). Switch Excel to STDEV.P to match the chart.
Fully Worked Nifty Example: Computing the Rupee Value
Here is the calculation the previous version of this page left unfinished. Take 20 daily Nifty closes that rise in a steady ramp from 23,100 to 25,000 in 100 point steps. These numbers are illustrative and chosen so the arithmetic is fully checkable; they are not a forecast and nothing here promises a return. The 20 closes are: 23100, 23200, 23300, 23400, 23500, 23600, 23700, 23800, 23900, 24000, 24100, 24200, 24300, 24400, 24500, 24600, 24700, 24800, 24900, 25000.
Step 1, the mean. The sum of these 20 values is 482,000, so the mean is 482000 divided by 20, which equals exactly 24,100. Note this is the true average; the old page on this site claimed a mean of 15,900 for its ramp, which was simply wrong because the midpoint of an even count sits between the two central values, not on a listed value.
Step 2 and 3, deviations and their squares. Because the data is a symmetric 100 point ramp around 24,100, the deviations are minus 950, minus 850, minus 750, and so on up to plus 950, in 100 point steps, with no zero in the middle. Squaring each gives values from 902,500 (for the 950 deviation) down to 2,500 (for the 50 deviation). There are two of each squared value by symmetry.
| Deviation from mean (points) | Squared deviation | Count in window |
|---|---|---|
| plus or minus 950 | 902,500 | 2 |
| plus or minus 850 | 722,500 | 2 |
| plus or minus 750 | 562,500 | 2 |
| plus or minus 650 | 422,500 | 2 |
| plus or minus 550 | 302,500 | 2 |
| plus or minus 450 | 202,500 | 2 |
| plus or minus 350 | 122,500 | 2 |
| plus or minus 250 | 62,500 | 2 |
| plus or minus 150 | 22,500 | 2 |
| plus or minus 50 | 2,500 | 2 |
Step 4, sum and average the squared deviations. Adding one of each squared value gives 3,325,000, and because every value appears twice the total sum of squared deviations is 6,650,000. Now divide. Population variance divides by n equals 20: 6,650,000 divided by 20 equals 332,500. Sample variance divides by n minus 1 equals 19: 6,650,000 divided by 19 equals 350,000.
Step 5, the square root, which gives the final answer in Nifty points. The square root of 332,500 is 605.53 points, the population standard deviation that a chart would plot. The square root of 350,000 is 621.06 points, the sample standard deviation a spreadsheet's STDEV would return. So the 20 day Standard Deviation for this Nifty series is 605.53 points on the chart, or 621.06 points by the sample formula. That single rupee, or rather point, figure is the number the indicator prints, and it is what the old page never stated.
An SD of about 606 points on a steadily trending series is large because a one directional ramp keeps closes far from the central average. On real, choppy Nifty data that oscillates around its mean, the 20 day SD is usually far smaller, often 100 to 300 points, even though the daily moves look similar. SD punishes trends and rewards consolidation.
From SD to the One Standard Deviation Expected Move
The most practical use of SD for an options trader is the expected move. If daily returns were normally distributed, about 68 percent of closes would land within one SD of the mean, about 95 percent within two SD, and about 99.7 percent within three SD. Real markets have fatter tails than the normal curve, so treat these as rough guides, not guarantees, but they are still the backbone of how the option chain is priced.
Say Nifty spot is 24,000 and the at the money straddle for the nearest weekly expiry (the Tuesday expiry after NSE's 2025 schedule change) is trading at a combined premium of 300 points. A quick market rule of thumb is that the ATM straddle price approximates the expected move to expiry. So the market is implying roughly a 300 point one SD move, meaning a close anywhere between about 23,700 and 24,300 by expiry is inside one SD, covering roughly 68 percent of the probability. If your own 20 day historical SD scaled to the days remaining is much smaller than 300, the options look expensive and an option seller has an edge; if it is much larger, options look cheap and a buyer is favoured.
- Scale daily SD to a horizon by multiplying by the square root of the number of trading days. A daily SD of 120 points over a 4 day week implies about 120 times the square root of 4, which is 240 points for the week.
- Compare historical SD (what actually happened) against implied volatility baked into option premiums (what the market expects) to spot rich or cheap premiums.
- Use one SD bands as a sanity check on stop placement: a stop inside one SD is very likely to be hit by ordinary noise, not by a genuine trend change.
A Rupee and Paisa F&O Example With Costs and Tax
Numbers below are illustrative, not advice, and there is no guaranteed return in options. Suppose your 20 day Nifty SD work suggests realised volatility is running well below the implied volatility in weekly options, so you decide to sell a one SD strangle on Nifty expecting price to stay inside the expected move. Nifty spot is 24,000. You sell one lot of the 24,300 call at 70 points and one lot of the 23,700 put at 65 points. Nifty's F&O lot size is 65.
Premium collected equals (70 plus 65) times 75, which is 135 times 75, equal to 10,125 rupees per strangle, before costs. If Nifty expires at 24,050, inside your one SD band, both options expire worthless and you keep the full premium minus costs. Costs on this round trip are roughly: STT on options is charged at 0.1 percent of premium on the sell side, so about 0.001 times 135 times 75, which is roughly 10 rupees; brokerage at a typical 20 rupees per order on two sells and (if they expired, no buy back needed) is about 40 rupees; plus exchange transaction charges, GST at 18 percent on brokerage and STT-exempt charges, SEBI fees and stamp duty, which together usually add another 15 to 30 rupees on a trade this size. Call total costs roughly 70 to 90 rupees.
So a clean expiry keeps you close to 10,040 rupees of gross profit. Now the tax. Profits from F&O are treated as business income in India, not capital gains, so there is no STCG or LTCG rate here. The net gain is added to your other income and taxed at your slab rate. If you fall in the 30 percent slab, the tax on this 10,040 rupee gain is about 3,012 rupees plus applicable cess, leaving roughly 7,000 rupees net. The flip side: if Nifty had broken out beyond your band, say closing at 24,600, the 24,300 call would be 300 points in the money, an intrinsic loss of 300 minus 70 equals 230 points times 75 equals 17,250 rupees, which dwarfs the premium collected. That asymmetry is exactly why SD based expected move analysis matters before you sell premium.
Because F&O is business income, you can set off losses and carry forward non-speculative business losses for up to 8 years, and a tax audit under section 44AB may apply depending on turnover. Keep a clean trade log. STCG at 20 percent and LTCG at 12.5 percent above 1.25 lakh apply to delivery equity, not to your F&O book.
Standard Deviation vs Bollinger Bands vs ATR
Traders often confuse the three main volatility tools. They measure related but distinct things. The plain SD indicator plots a single line of the standard deviation value itself. Bollinger Bands take that same SD and draw it as a channel around a moving average, so the bands literally widen and narrow with SD. The Average True Range (ATR) measures something subtly different: the average size of the full daily range including gaps, not the dispersion of closes around a mean.
| Tool | What it measures | Output unit | Best used for |
|---|---|---|---|
| Standard Deviation line | Dispersion of closes around their moving average | Price points or rupees | Spotting volatility expansion and contraction |
| Bollinger Bands | SD drawn as a band, mean plus or minus 2 SD | A price channel | Mean reversion, squeeze breakouts |
| ATR | Average full daily range including gaps | Price points or rupees | Stop distance and position sizing |
| Implied Volatility (from options) | Market's expected future volatility | Annualised percent | Judging if option premiums are rich or cheap |
The practical takeaway: use the SD line or Bollinger Bandwidth to see when volatility is unusually compressed (a squeeze), use ATR to set stops that respect the instrument's normal range including overnight gaps, and use implied volatility from the option chain to decide whether you want to be a net buyer or seller of premium. They complement rather than replace each other.
Best Settings for Nifty, Bank Nifty and Single Stocks
The 20 period setting on daily closes is the default for a reason: it aligns with the 20 period Bollinger Band basis and roughly one trading month of data, which smooths out single day noise without lagging too badly. For Bank Nifty, which is structurally about 1.7 to 2 times as volatile as Nifty, the same 20 period SD will naturally print a larger number, often 250 to 600 points, and that is expected, not an error. Do not compare Bank Nifty's raw SD to Nifty's raw SD; compare each to its own price as a percentage.
- Intraday scalpers on 5 minute charts: a 14 to 20 period SD reacts fast enough to flag volatility bursts around 9:15 am open and 3:30 pm close.
- Swing traders on daily charts: stick with the standard 20 period to stay in sync with Bollinger Bands and most published studies.
- Positional and portfolio risk: a 50 or 100 period SD smooths out event spikes and gives a steadier read on a stock's baseline risk.
- Single stocks like Reliance, HDFC Bank or TCS: always convert SD to a percentage of price before comparing across names, since a 40 rupee SD means very different things on a 1,500 rupee stock versus a 4,000 rupee stock.
One more setting note specific to Indian markets: SD readings spike predictably around scheduled events such as RBI monetary policy, the Union Budget, quarterly results and monthly F&O expiry. A jump in the SD line into one of these events is usually the option market pricing in a known catalyst, not a random signal. Plan around the calendar rather than reacting to the indicator blindly.
Trading the Squeeze: SD Contraction and Expansion
The single most actionable pattern from SD is the volatility cycle. Volatility is mean reverting: long quiet periods of low SD tend to be followed by sharp expansions, and violent high SD periods tend to exhaust and contract. When the SD line drops to a multi week low, often visible as a Bollinger Band squeeze where the bands pinch together, the market is coiling. This does not tell you which way it will break, only that a bigger move is becoming more likely.
A disciplined way to trade this on Nifty is to wait for the squeeze, then let price and a confirming tool pick the direction. For example, hold off until price closes outside the contracted Bollinger Band and a momentum tool such as the Relative Strength Index (RSI) agrees. Because the move out of a squeeze can be fast, options buyers sometimes favour these setups since a long option's loss is capped at the premium paid while the upside rides the expansion. Always size so that the premium at risk is a small, pre decided fraction of capital.
Risk Management and Position Sizing With SD
SD turns vague risk into a number you can size against. A common rule is to place stops at least one SD away from entry so ordinary noise does not knock you out, and to size the position so that being stopped at one SD costs no more than a fixed percentage of capital, commonly 1 to 2 percent. If Nifty's daily SD is 150 points and you trade 1 lot of 65, a one SD adverse move is 150 times 65 equals 9,750 rupees. For that to be 1 percent of capital you would need a trading account of about 9.75 lakh, which is a sobering reality check on how much capital index F&O really demands.
- Set stops beyond one SD, not inside it, so normal volatility does not trigger them.
- Reduce position size when SD is rising; a fixed lot count carries more rupee risk as volatility expands.
- Translate SD into a rupee figure (SD times lot size) before every trade so you know the real money at stake.
- Respect the calendar: widen stops or cut size ahead of RBI policy, Budget and results when SD predictably spikes.
This is also the honest limitation of the indicator. SD is backward looking, computed only from prices that already happened, so it lags sudden regime changes and can lull you during the quiet before a shock. It says nothing about direction. And on thinly traded stocks a few outlier prints can inflate SD misleadingly. Treat it as one input into risk, confirmed by price action and the option market, never as a standalone trade trigger.
Sources and Further Reading
For authoritative data and contract specifications, refer to Zerodha Varsity, NSE India for lot sizes and expiry schedules, the SEBI site for current rules, and the Income Tax Department for how F&O business income and equity capital gains are taxed. Always confirm current rates, lot sizes and contract terms on the official source before you trade, since they change.
Sources and Further Reading
For authoritative data and further reading on this topic, refer to Zerodha Varsity, Investopedia, NSE India and Reserve Bank of India. Always confirm current rules, rates and contract specifications on the official source before you trade.
Related Topics
Related Articles
Understanding Limit Orders in Indian Markets
How limit orders work on the NSE, with a real bid-ask order book, tick sizes, and worked Reliance, HDFC Bank and Nifty examples with charges.
Understanding the Harami Pattern in Indian Markets
What a harami pattern is, bullish vs bearish, a real dated Nifty 2024 reversal example, F&O rupee maths, confirmation rules and India tax basics.
Understanding the Flag Pattern in Indian Markets
How to trade bullish and bearish flag patterns on Nifty, Bank Nifty and NSE stocks, with a worked example, costs, taxes and honest reliability data.
Understanding Trading Psychology in Indian Markets
Learn trading psychology for Indian markets with a worked Nifty options example showing how fear and greed turned a Rs 3,600 loss into Rs 16,500.
Pair Trading Strategy for Indian Markets
Pair trade TCS and Infosys with real z-score math, lot sizes, rupee P&L, STT and slab-rate tax. A worked, market-neutral guide for Indian traders.
Understanding the Diamond Top Pattern in Indian Markets
Spot the diamond top reversal on Bank Nifty with a dated Oct 2024 example, options P&L in rupees, targets, stops and Indian F&O tax rules.
The trading journal built for Indian F&O traders. Track your trades, spot patterns, build discipline.
- Log one trade a day by hand, on purpose
- AI mentor finds your repeat mistakes
- Behavioural analytics catch tilt early
- Trading calendar with P&L heatmap
- Pre-trade checklist flags risks
Yearly ₹2,499 · No broker credentials