The stochastic oscillator is a momentum indicator developed by George Lane in the 1950s. The idea behind it is simple: in a rising market, prices tend to close near the top of their recent range; in a falling market, near the bottom. The stochastic measures exactly that, as a number between 0 and 100. A reading of 90 means the latest close is near the top of the recent range. A reading of 10 means it is near the bottom.
Despite the mathematical-sounding name ("stochastic" means random), it is one of the easiest indicators to understand and calculate by hand.
How %K is calculated
The standard setting looks back 14 bars. Find the highest high and the lowest low in those 14 bars, then see where the latest close sits between them:
%K = (close − lowest low) ÷ (highest high − lowest low) × 100
Example: over the last 14 days a stock's highest high was ₹820 and its lowest low ₹760, so the range is ₹60. Today it closes at ₹805. That is ₹45 above the low, and ₹45 ÷ ₹60 = 0.75, so %K is 75: the stock closed three quarters of the way up its two-week range.
| Close | Position in ₹760–₹820 range | %K |
|---|---|---|
| ₹820 | At the high | 100 |
| ₹805 | Three quarters up | 75 |
| ₹790 | Middle | 50 |
| ₹766 | Near the low | 10 |
Fast, slow and full stochastic
Raw %K jumps around a lot. Two smoothings are used:
- Fast stochastic: raw %K, plus %D as a 3-bar average of it. Very jumpy.
- Slow stochastic: %K is first smoothed over 3 bars, and %D is a 3-bar average of that. This is what most charts show by default, written as (14, 3, 3).
- Full stochastic: the same idea with all three numbers adjustable.
%D is the slower line and acts like a signal line, much as the signal line does for MACD. ScreenerCharts uses the (14, 3, 3) slow stochastic in the screener and scans.
Overbought, oversold and crossovers
The two levels everyone watches are 80 and 20:
- Above 80 (overbought): the price has been closing near the top of its range. It may be stretched, but it may also be strong.
- Below 20 (oversold): the price has been closing near the bottom of its range.
- Bullish crossover: %K crosses above %D, especially below 20. The stochastic oversold crossover scan lists stocks where this happened.
- Bearish crossover: %K crosses below %D, especially above 80.
The critical word is "may". In a strong uptrend a stock can stay above 80 for weeks while rising steadily. Selling every time it crosses 80 means fighting the trend. Lane himself focused less on the levels and more on divergence.
A worked trade in a range
Suppose a stock has moved between about ₹760 and ₹820 for two months, and its ADX is 15: a quiet, sideways market where the stochastic tends to work. The price falls to ₹766 and the slow stochastic drops to 12, then %K turns up and crosses above %D at 18. A range trader might buy near ₹770 with a stop below the range at ₹752, aiming for the middle of the range (₹790) or the top (₹815). The risk is about ₹18 a share; the reward to the top is about ₹45, roughly two and a half times the risk.
Now change one thing: the stock has been falling for weeks, ADX is 32 and −DI is well above +DI. The same stochastic reading of 12 is no longer a sign of a turn; it is a sign of a strong downtrend, and the stock may slice through ₹760 without pausing. The indicator reading is identical in both cases, but the context decides whether it means anything. This is why most experienced traders never use the stochastic on its own.
The same idea applies to the exit. In a range, many traders sell when the stochastic reaches 80 near the top of the range. In a rising trend, they ignore readings above 80 and exit only when the price breaks below a recent swing low or a moving average.
Divergence
A bullish divergence happens when the price makes a lower low but the stochastic makes a higher low. Say a stock falls to ₹760 with the stochastic at 5, bounces, then falls again to ₹752, but this time the stochastic only reaches 18. The new low in price came with less downward momentum. A bearish divergence is the mirror image at highs. Divergences are warnings that a move is tiring, not timing signals; a divergence can persist through several more lows.
Stochastic and RSI on a live stock
The stochastic and RSI are cousins: both measure momentum on a 0 to 100 scale. RSI compares the size of up-closes to down-closes; the stochastic compares the close with the high-low range. Here are today's readings for State Bank of India:
The box shows the 14-day RSI. The stochastic for the same stock is on its technicals page. When both are high (RSI above 70, stochastic above 80), momentum is clearly strong. When the stochastic is at an extreme but RSI is near 50, the stock has simply moved to the edge of a narrow recent range, which is a weaker message. Compare the trend readings too: oscillator signals against a rising 50-day and 200-day average are risky to trade as "overbought" sells. The RSI guide covers the other half of this pair.
When the stochastic works and when it does not
The stochastic is a range tool. It shines when a stock or index is moving sideways between support and resistance, because in a range the price really does turn near the top and bottom. In strong trends it gives repeated wrong signals. The ADX helps decide which kind of market you are in: many traders use stochastic signals only when ADX is below about 20, or take only the signals in the trend's direction (buy oversold dips in an uptrend, sell overbought rallies in a downtrend).
A related indicator, the Stochastic RSI, applies the stochastic formula to RSI values instead of prices. It moves even faster and reaches the extremes more often. The screener has both.
Common mistakes
- Selling just because it is above 80. Overbought is a description, not a sell signal.
- Trading every crossover. On a daily chart %K and %D cross often; on intraday charts constantly. Combine crossovers with support levels or a candlestick signal.
- Ignoring the trend. Check the 50 and 200-day averages and ADX first.
- Short look-back on volatile stocks. A 5-bar stochastic on a jumpy stock swings from 0 to 100 in a day.
- Not testing. A rule that "looks right" on three charts may lose over three hundred trades. Try it in the backtester.