Stochastic oscillator: how %K and %D work, best settings and how to read it
What is the stochastic oscillator?
The stochastic oscillator is a momentum indicator that answers one simple question: where did price close inside its recent range? If the last close sits near the top of the highest high and lowest low of the past 14 candles, the reading is near 100. If it sits near the bottom, the reading is near 0.
George Lane popularised the stochastic indicator in the 1950s. His idea was that in a healthy up-move candles tend to close near their highs, and in a healthy down-move they close near their lows. When closes stop pushing to the edge of the range, momentum is fading, and that often shows on the oscillator before it shows clearly on price.
The indicator is bounded between 0 and 100 and is drawn as two lines: the faster %K and its average, %D. It sits in a separate pane below the chart, much like the RSI indicator.
Slow %K = 3-period SMA of fast %K
%D = 3-period SMA of slow %K (common setting 14, 3, 3)
The stochastic formula, step by step
Take the default 14-period setting. Find the highest high and lowest low of the last 14 candles. Subtract the lowest low from the current close, divide by the full range, and multiply by 100. That is fast %K.
A quick numeric illustration
Suppose over the last 14 five-minute candles NIFTY's high is 24,180 and its low is 24,060, a range of 120 points. The current candle closes at 24,150. Fast %K = (24,150 − 24,060) ÷ 120 × 100 = 75. Price closed three-quarters of the way up its recent range.
Fast, slow and full stochastic
- Fast stochastic: raw %K with a 3-period %D. Very jumpy.
- Slow stochastic: %K is smoothed by 3 first, then %D is a 3-period average of that. This is what most charting platforms show by default as 14, 3, 3.
- Full stochastic: you choose the lookback, the %K smoothing and the %D smoothing yourself.
For most traders the slow version is the sensible starting point, because the fast version produces too many crossovers on intraday charts.
How to read the stochastic indicator
Overbought 80 and oversold 20
Readings above 80 are called overbought and readings below 20 oversold. These words mislead beginners. Overbought only means price has closed near the top of its range for a while. In a strong trend NIFTY can stay above 80 for an hour or more while it keeps rising.
%K and %D crossovers
When %K crosses above %D, short-term momentum is turning up; when it crosses below, momentum is turning down. A crossover below 20 or above 80 carries more weight than one in the middle, because it happens at an extreme of the range.
The 50 line
Many traders treat 50 as a trend filter. Readings that keep holding above 50 during pullbacks show buyers in control of the range; readings that keep failing below 50 show sellers in control.
Stochastic divergence
A bearish divergence forms when price makes a higher high but the stochastic makes a lower high. A bullish divergence is the mirror. Divergence says momentum is weakening, not that price must reverse, so it works best at a meaningful level such as a key level or liquidity pool.
Best stochastic settings for intraday NIFTY 5-minute
There is no single best setting, only trade-offs between speed and noise. These are common starting points traders test:
| Use | Setting | Character |
|---|---|---|
| Default, balanced | 14, 3, 3 | Good general reading on 5-minute NIFTY and BANKNIFTY |
| Faster scalping | 5, 3, 3 | Many crossovers, needs a strong filter |
| Smoother swings | 21, 5, 5 | Fewer, slower turns; suits 15-minute charts |
BANKNIFTY moves in larger, faster swings than NIFTY, so some traders prefer a slightly longer lookback there to reduce whipsaws. Whatever you choose, keep it fixed for a few weeks and record results in your trading journal before changing it.
Stochastic oscillator strategy ideas (educational)
The ideas below are ways traders study the indicator. They are frameworks to test, not instructions.
1. Trend pullback
Decide trend first with a higher timeframe or a slower tool such as the 50 EMA from the moving averages guide. In an uptrend, only pay attention to the stochastic dipping below 20 and turning back up. The trend gives direction; the oscillator only times the pullback.
2. Range edges
On a sideways day, when NIFTY is rotating between the previous day's high and low or around the CPR, overbought and oversold readings near the range edges are more meaningful, because there is no trend pushing price through them.
3. Divergence at a level
A divergence alone is weak. A divergence that forms exactly at a prior swing high, a VWAP band or a high volume node gives the trader two independent reasons to watch for a reaction.
Real vs false stochastic readings
The biggest weakness of the stochastic indicator is false crossovers in trends. In a strong trending session the oscillator may cross down from 80 five times while NIFTY keeps grinding higher.
Signs a reading is weak
- It goes against a clear higher-timeframe trend.
- It forms in the middle of the range, around 40 to 60.
- Price is making strong, wide candles with rising volume in the trend direction.
Signs a reading has more weight
- It agrees with the trend (oversold dip inside an uptrend).
- It happens at a known level.
- Volume or order flow confirms that the push into the level is running out of fuel.
Pairing it with ADX helps: when ADX is high and rising, treat overbought and oversold with suspicion; when ADX is low, the market is ranging and the oscillator's extremes behave better.
Combining the stochastic with volume and footprint
The stochastic is built only from price. Adding volume information fills the gap. When the oscillator is overbought at a resistance level, a footprint chart can show whether aggressive buyers are still lifting offers or whether their buying is being absorbed by passive sellers.
If the footprint shows heavy buying with little price progress at the high, that is absorption, and it adds weight to the stochastic's warning. If buying volume simply dries up at the high, that is exhaustion. A falling cumulative delta while the stochastic diverges is another way to see sellers quietly gaining control.
Worked NIFTY example (illustration)
This is an illustration with plausible numbers, not a record of a real trade. NIFTY opens at 24,100 and trends up to 24,240 by 11:00 IST. The 5-minute stochastic (14, 3, 3) has stayed above 80 for most of the move; a trader who treated every 80 crossover as a reversal would have been wrong three times.
At 11:30 price pulls back to 24,190, close to the session VWAP, and the stochastic drops to 15. The higher-timeframe trend is still up. At 11:45 %K crosses above %D below 20 and price closes back above VWAP. A trader studying this setup would note the pullback low at 24,182 as the level that, if broken, would cancel the idea. Later in the afternoon NIFTY makes a new high at 24,270, but the stochastic peaks at 84 versus 96 earlier: a bearish divergence near the day's high that suggests momentum is cooling.
Trading F&O carries a high risk of loss; examples like this are for learning how the indicator behaves, not a promise of any outcome.
Common stochastic mistakes
- Fading every overbought reading in a trending market.
- Using the fast stochastic on 1-minute charts and drowning in noise.
- Ignoring the trend: the oscillator has no idea which way the bigger picture points.
- Changing settings daily to make yesterday's chart look perfect.
- Treating divergence as a trigger rather than a warning. Momentum can diverge several times before price turns.
- No exit plan: decide the invalidation level before acting, and size with position sizing rules.
Seeing it on the TradingMarble chart
The TradingMarble chart lets you add the stochastic oscillator in its own pane under NIFTY, BANKNIFTY and F&O charts and change its periods. You can place it beside the footprint, VWAP and volume profile so you can study how momentum readings line up with real buying and selling at each level. See the features page for the full tool list.
Stochastic oscillator checklist
- What is the higher-timeframe trend?
- Is the stochastic at an extreme (below 20 or above 80) or in the middle?
- Did %K cross %D in the direction of the trend?
- Is price at a meaningful level?
- Does volume or footprint agree?
- Where is the level that proves the idea wrong?
Used this way, the stochastic oscillator becomes a timing tool inside a plan rather than a standalone system.
Frequently asked questions
What is the stochastic oscillator in simple words?
The stochastic oscillator shows where the current close sits within the high-low range of the last N candles, on a scale of 0 to 100. A reading near 100 means price closed near the top of its recent range; near 0 means it closed near the bottom. It is used to judge momentum and spot possible turning points.
What are the best stochastic settings for intraday trading?
The default 14, 3, 3 slow stochastic is a balanced starting point on 5-minute NIFTY and BANKNIFTY charts. Scalpers sometimes use 5, 3, 3 for speed, but it creates many more false crossovers. Swing traders may use 21, 5, 5. Test one setting consistently and judge it over many sessions rather than a single day.
What is the difference between %K and %D?
%K is the main line showing where the close sits in the recent range. %D is a moving average of %K, usually over 3 periods, so it moves more slowly. Crossovers between the two show short-term changes in momentum, and crossovers at extreme readings above 80 or below 20 are watched most closely.
Is stochastic better than RSI?
Neither is better; they measure different things. RSI compares the size of up-moves to down-moves using Wilder's smoothing, while the stochastic compares the close to the high-low range. The stochastic is faster and more sensitive, which suits ranges, while RSI tends to be steadier in trends. Many traders pick one rather than stacking both.
What is the difference between slow and fast stochastic?
The fast stochastic uses raw %K, which reacts to every candle and gives many crossovers. The slow stochastic smooths %K with a 3-period average before calculating %D, so it is calmer and easier to read. Most platforms show the slow version by default.
Can the stochastic stay overbought for a long time?
Yes. In a strong trend price keeps closing near the top of its range, so the stochastic can stay above 80 for many candles. That is a sign of strength, not an automatic reversal. This is why traders combine the stochastic with a trend filter such as ADX or moving averages.