Guide · Indicators
What is the stochastic oscillator?
The short answer
The stochastic oscillator asks one question and nothing else: where did the close sit inside its own recent range? Take the last N sessions, find the lowest low and the highest high, and measure how far up that span the latest close finished. Expressed from 0 to 100, that is %K. The signal line, %D, is a short average of %K. George Lane built it in the late 1950s on the observation that closes cluster near the top of the range in an uptrend and near the bottom in a downtrend. That single question is the whole of what the tool knows, and almost every mistake made with it comes from forgetting how little that is.
Two consequences follow from that one question, and readers get both of them wrong. The first is that the stochastic is a range-position meter, not a strength meter. "Overbought" does not mean the move has gone too far; it means the close finished near the top of its recent range, which is exactly what a healthy uptrend does every single day. The second is that because the recent range is the denominator, the reading is hypersensitive when the range is tight and sluggish when it is wide, so the same rupee move is worth wildly different amounts of %K in different weeks. This guide builds the formula from the range up, and then proves both consequences with figures that compute %K from a drawn price series rather than illustrating it.
The one question: where did price close in its range?
Every other momentum indicator starts from how far price has moved. RSI compares the size of recent gains to the size of recent losses. MACD measures the distance between two averages. The stochastic starts from a different and subtler place: not how far, but where. Over the last N sessions the instrument carved out a range with a lowest low and a highest high. The oscillator discards nearly everything about what happened inside that window, the path, the order of events, the volume, the size of the individual sessions, and keeps exactly three numbers: the lowest low, the highest high, and today's close. Then it asks how far up the span that close finished. At the top of the range the answer is 100. At the bottom, 0. Halfway, 50.
Lane's observation, the one that gives the tool its reason to exist, is that this position tends to shift before price does. When buyers are in control, each session keeps closing in the upper part of its range even on days the range itself does not expand much. When sellers take over, closes start finishing in the lower part of the day even while the highs are still creeping up. The close drifting down the range can begin while price is still making marginally higher highs, which is why the stochastic is treated as a gauge that can flag a loss of drive before the price line bends. Lane's own image for it was a rocket: before it can turn down, it must first slow down.
Look at what that construction throws away. The oscillator does not know the price of the instrument, so a reading of 87 says nothing about whether the index is at 22,000 or 82,000. It does not know whether the 250 point range it just measured is unusually tight or unusually wide for this market. It does not know whether the window sat inside a trend or a drift. It has been handed three numbers and asked for a ratio, and it returns one honestly. Normalising to a fixed 0 to 100 scale is precisely what makes the tool comparable across instruments and timeframes, and it is also precisely what makes it blind: the scale is rebuilt from scratch out of whatever range the last N bars happened to produce. If you are new to reading indicators at all, the broader frame in our guide to technical analysis for beginners is the better place to start, because an oscillator is only ever the last mile of a decision.
The formula: %K and %D, built from the range
The main line writes the idea directly as arithmetic. Over the look-back of N periods, the default is 14, take the current close, subtract the lowest low of the window, and divide by the full span of the window, its highest high minus its lowest low. Multiply by 100 to put it on a percentage scale.
N = look-back periods, default 14. Bounded 0 to 100 by construction.
%D = 3-period simple moving average of %K (the signal line)
Three things follow from the shape of that fraction, and each one matters later. First, %K cannot leave the 0 to 100 band: the close is always somewhere between the lowest low and the highest high of its own window, so the numerator can never exceed the denominator nor fall below zero. The bound is not a convention or a clamp, it is arithmetic. Second, the signal line %D is nothing more than a short average of %K, a 3-period simple moving average by default, which drags out the jitter so the two lines can be read against each other. Third, and least discussed, the denominator is rebuilt on every bar. Tomorrow's reading is measured against a different range from today's, because one bar drops out of the window and a new one enters. The yardstick is being re-cut under the number as you read it.
A worked step makes it concrete. Suppose over the last 14 sessions a large-cap Indian index carved a low of 22,000 and a high of 23,000, a 1,000 point range, and today it closes at 22,800. Then %K = 100 × (22,800 − 22,000) ÷ (23,000 − 22,000) = 100 × 800 ÷ 1,000 = 80. The close finished four fifths of the way up its range, so the raw stochastic reads 80. Move the same close to 22,300 and the reading falls to 30 with the range untouched. Note what has not been established by either number: whether the index is rising, whether 1,000 points is a lot, or whether anything is about to happen. All figures on this page are illustrative.
The pin: overbought describes a trend, it does not warn about one
This is the honest core of the tool, and it is where most of the money is lost. The 80 and 20 lines encode a hidden assumption that nobody states out loud: that price is oscillating inside a range, so a close near the top will shortly be followed by a pullback toward the middle. In a genuine range that assumption holds and fading the extremes has real logic behind it. In a trend it does not merely weaken. It inverts.
The mechanism is worth being precise about, because once you see it the behaviour stops being a quirk and becomes inevitable. The lowest low in the denominator is anchored roughly N bars back. As an uptrend extends the highest high day after day, that low sits still, two or three weeks in the past, until it finally drops out of the window and is replaced by another low that is also far below current price. So the range keeps stretching upward from a fixed floor, and the close keeps finishing near the top of it. Even a real pullback, one that costs a hundred points and feels unpleasant to hold, leaves the close high inside a range measured against ancient history. %K climbs to 80 and simply stays there. Chartists call this embedding.
The consequence is the single most expensive misuse of the indicator. A trader who reads "overbought" as "due to fall" and sells is selling into strength, and the trend runs them over one higher close at a time. It is worse than a signal that simply fails, because this one arrives with confidence and repeats daily: thirty seven consecutive invitations to do the wrong thing, each apparently confirmed by the fact that the reading is still extreme. The mirror image happens in a downtrend, where the oscillator embeds below 20 and every "oversold" bounce-buy is caught by the next leg down. The same trap catches RSI for the same underlying reason, which is covered in our guide to RSI and the overbought trap.
A pinned stochastic is not the indicator failing. It is the indicator working perfectly, reporting exactly what it was asked, while the question itself has quietly become the wrong one to ask.
The range is the denominator, so the reading rescales itself
The second consequence of the formula is quieter than the pin and almost never taught, but it explains a behaviour that confuses people constantly: why the stochastic looks jumpy and hair-triggered for a few weeks and then sleepy for the next few, on the same instrument, with the same settings. Nothing about the tool changed. The denominator did.
Because %K divides by the recent range, the size of that range sets how much a single close is worth. In a coiled market the range is small, so a modest move is a large fraction of it and the reading travels a long way. In a wide, volatile market the identical move is a small fraction of a big range and barely registers. The figure below isolates that effect completely: two 14 bar windows, both ending with the close at exactly 40 on the stochastic scale, both then given the identical 20 point close. Nothing else about the two cases differs, and neither denominator changes when the move lands.
This has practical teeth. It means a threshold like 80 is not a constant across time even on one instrument: reaching it requires a genuine push when the market is wide and almost nothing when the market is coiled. It means readings from a quiet fortnight and a violent fortnight are not really the same measurement, despite sharing a scale. And in Indian equities it interacts with a structural feature of the market: because the cash session runs 09:15 to 15:30 IST and prices absorb overnight global cues at the open, a gap can print a new 14 bar extreme in a single tick, resetting the denominator before the session has traded. The range in the formula is not a stable yardstick. It is whatever the last N bars happened to leave behind.
Fast, slow and full: the variants exist because the raw line is unusable
The bare calculation above is the fast stochastic: fast %K is the raw formula and fast %D is its 3-period average. It is faithful to every close, which is exactly the problem. Because it reacts to every close and rescales to its own recent range, it changes direction constantly and throws off a stream of crossovers, most of which lead nowhere. The slow stochastic inserts one extra smoothing step: it replaces the raw %K with its own 3-period average and displays that as the new slow %K, then averages that again for slow %D. In other words, the slow %K is exactly the fast %D, with a second average laid on top. The full stochastic simply exposes all three numbers, the look-back and both smoothing lengths, as user settings.
Most explanations stop at describing the difference. The honest point is why the variants exist at all, and it is not flattering to the tool: the raw line is too noisy to act on, and the smoothed versions are the industry quietly admitting it. The figure below counts the admission.
| Component | Fast | Slow | Full |
|---|---|---|---|
| %K (main line) | The raw formula, unsmoothed | The raw %K averaged over 3 | The raw %K averaged over a length you choose |
| %D (signal line) | The raw %K averaged over 3 | The slow %K averaged over 3 | The full %K averaged over a length you choose |
| Settings exposed | Look-back only | Look-back only | Look-back, %K smoothing, %D smoothing |
| Crossings, same 40 bars | 16 | 8 | 5 |
| What you gain | Every close is reflected immediately | Most of the false crosses disappear | Control over exactly how much is averaged |
| What you pay | Most crossings are noise | The line arrives later | More dials, and more ways to fool yourself |
The takeaway is not that one setting is correct. It is that the numbers on the panel are smoothing choices, not accuracy dials. A shorter look-back with less smoothing reacts sooner and lies more often; a longer one is steadier and later. There is no configuration that converts a lagging summary of past closes into a forecast, and hunting for one has a name in research: if you try enough parameter sets on one history and keep the best, you have selected a winner rather than found one. Our guide to backtesting integrity covers why that search manufactures an impressive number out of pure chance, and what an honest test of an indicator rule actually requires.
Divergence is a hypothesis, not a signal
Divergence is when price makes a new extreme and the oscillator does not: price prints a higher high while %K prints a lower high, or price makes a lower low while %K makes a higher low. Lane rated it above everything else the tool offers, and he was right to. It is the one reading that uses the stochastic for what it is actually good at, detecting a change in where closes are finishing while price is still stretching.
The mechanism deserves stating plainly, because it is rarely explained and it makes the reading far easier to trust in the right way. At a genuine new 14 bar high, the close is the top of its own range, so %K is near 100 almost by definition. The only way price can make a higher high while %K makes a lower one is if that new high is being sold into: the session pokes above the old high and then closes well below it, leaving a rejection wick. %K reads the close, not the high, so it reports the retreat. Divergence, in stochastic terms, is a measurement of rallies that are being faded intraday. That is a real and meaningful thing to detect. It is also, crucially, a thing that can go on for a very long time.
That is the difference between a hypothesis and a signal, and it is worth holding onto. A hypothesis says: the character of this advance has changed, and I should now be looking for evidence of a turn. A signal says: act. The stochastic can support the first and cannot support the second, because the tool contains no information whatsoever about when, and no amount of confirmation from a second divergence supplies it. What resolves a divergence is not the oscillator. It is price: a broken structure, a failed retest, a level that gives way. The divergence tells you which chart to have open. It does not tell you what to do with it.
The regime filter is the judgement upstream of the indicator
Pull the last three sections together and one conclusion is unavoidable: the same reading carries opposite information depending on the regime. A close pinned near the top of its range is a warning in a range and a confirmation in a trend. The figure at the top of this page made that concrete with two nearly identical numbers, 91 and 92, that preceded a small fade and a 6.5% advance. No setting on the indicator panel distinguishes those two cases, because the information that distinguishes them is not in the indicator. It never was.
| The reading | In a ranging market | In a trending market |
|---|---|---|
| %K above 80 | The close is high in a bounded range; a pullback toward the middle is plausible | Momentum is strong and the reading may embed for weeks; fading it means selling strength |
| %K below 20 | The close is low in a bounded range; a bounce toward the middle is plausible | Downtrend momentum is strong; buying the "oversold" dip is caught by the next leg |
| %K / %D crossover | A modest cue that the range may be turning at its edge | Frequent, and mostly noise against the dominant direction |
| Divergence in the zone | A meaningful warning that the range extreme may hold | Can print repeatedly for months before price turns; still only a hypothesis |
| A very fast swing in %K | Informative if the range is genuinely tight | Often just a coiled denominator, not a change in conviction |
| The right posture | The bands are informative; treat them as context, not command | Read the level as trend strength; never fade the extreme mechanically |
So the question that decides whether the stochastic is useful today is not a question the stochastic can answer: is this market ranging or trending? That judgement sits entirely upstream of the oscillator, and it has to be made with something else, whether that is trend structure read off the chart or a dedicated tool. The ADX indicator exists for exactly this job, measuring trend strength without regard to direction, and that guide is the right place for the question of when an oscillator is simply the wrong instrument to have picked up. Getting the regime call right is most of the work, and it is a skill rather than a setting, which is why the method we teach is built around the judgement rather than the indicator.
The failure modes, named
Every one of these follows from the same root: the tool answers one question honestly, and the reader silently substitutes a different question it never answered. Naming them individually is useful because they show up in different disguises.
| The misuse | What the trader hears | What the number actually said |
|---|---|---|
| Fading the pin | "Overbought, so it is due to fall" | "The close finished near the top of its range", which is what an uptrend does daily. The reading held above 80 for 37 straight sessions in the figure above |
| Trading every crossover | "%K crossed %D, so momentum turned" | "The last three closes averaged slightly differently from the last one." The raw line did that 16 times in 40 sessions of a market going nowhere |
| Acting on a divergence | "Momentum is fading, so the top is in" | "Recent highs are being sold into." It says nothing about when, and the first one in the figure above was 44 sessions early |
| Comparing readings across weeks | "It hit 80 again, same as last month" | "The close is 80% up this range." A different range, so a different measurement wearing the same number |
| Tuning the settings | "14 is not working, I will find a length that does" | Nothing. The length changes how much is averaged, not what is known. Searching lengths on one history selects a winner rather than finding one |
None of this is academic in the Indian retail context. A mechanical band rule is attractive precisely because it is easy to apply without forming a view, and applying rules without a view is expensive: about 93% of individual traders in equity derivatives made net losses over FY22 to FY24, aggregate net losses exceeding ₹1.8 lakh crore (SEBI, September 2024). That figure is not a verdict on the stochastic, which is a perfectly honest piece of arithmetic. It is a verdict on the gap between how simple an indicator rule looks and how much judgement it silently assumes. Anyone tempted to find out whether "sell above 80" pays should measure it properly rather than eyeball it, and measuring it properly is a harder job than it looks.
What the number knows, and what it does not
The stochastic belongs to the reading layer of a chart, the part where you form a view of momentum and context before any decision. It is genuinely good at one narrow thing: compressing "where is the close finishing inside its recent range, and is that drifting" into a single bounded number you can track across instruments and timeframes. Inside a range its extremes have a real logic, and its divergences detect something true about rallies being sold. What it is not, and was never built to be, is a trigger or a forecast. It summarises past closes. It cannot see the next one.
What %K actually knows
- The lowest low and the highest high of the last N bars, and nothing else about them.
- Today's close, and how far up that span it landed.
- That the answer is bounded between 0 and 100, because the close cannot escape its own range.
- That closes drifting down the range while highs still rise is a real, measurable change in character.
What it does not know
- Whether the market is trending or ranging, which is the one fact that decides what its reading means.
- Whether 250 points is a wide range or a tight one for this instrument, this month.
- Anything about when. No level, cross or divergence carries timing information.
- Whether the move has gone too far. "Overbought" is a position in a range, not a verdict on value.
Read that ledger honestly and the tool becomes useful, because you stop asking it the questions it cannot answer. The left column is worth having on a chart. The right column is the entire job, and none of it is on the indicator panel. Which is the real lesson of the stochastic, and the reason it has survived seventy years of misuse: the oscillator is the easy part. A first-year trader can compute %K. Knowing whether today is a day to believe it takes a view of the market that has to be formed before the number is ever consulted, and that view is built from structure, from regime, and from having decided in advance what would change your mind.
Common Questions
Frequently Asked Questions
What does the stochastic oscillator measure?
+It measures where the latest close sits within the recent high-to-low range, on a fixed scale of 0 to 100. George Lane's insight was that in an uptrend closes cluster near the top of the range, and in a downtrend near the bottom, so the close's position often shifts before price itself turns. A reading near 100 means the close is at the top of the range and near 0 means the bottom. That is the whole of what it knows: it does not know the price, the trend, the volume or the size of the range it just measured.
What is the stochastic oscillator formula?
+The main line is %K = 100 times (Close minus the lowest low over N periods) divided by (the highest high over N periods minus the lowest low over N periods), with N defaulting to 14. Because the close is expressed as a fraction of its own range, %K is bounded between 0 and 100 by construction. The signal line %D is a short simple moving average of %K, by default a 3-period average, which smooths the raw line.
What is the difference between %K and %D?
+%K is the raw line that compares the latest close to the recent high-low range. %D is a short simple moving average of %K, by default 3 periods, that smooths it into a steadier signal line. %K reacts faster to each new close, and %D lags slightly, so traders watch the two lines and their crossovers. Lane himself treated %D, the smoothed line, as the more meaningful one.
What is the difference between fast, slow and full stochastic?
+The fast stochastic plots the raw %K and its 3-period average %D, so it is quick but noisy. The slow stochastic applies one extra smoothing step: it takes a 3-period average of the raw %K and treats that as the new, slower %K, then averages that again for %D. The full stochastic exposes all three numbers, the look-back and both smoothing lengths, as user settings. They are not three indicators. They are one number averaged different amounts, and the variants exist because the raw line changes direction too often to act on.
What do the 80 and 20 lines mean on the stochastic?
+Readings above 80 are conventionally called overbought and readings below 20 oversold, meaning the close is sitting very high or very low in its recent range. These are descriptive zones, not buy or sell instructions. The word overbought is the single most misleading label in technical analysis: it describes where the close finished, not whether the move has gone too far. In a strong trend the oscillator can stay above 80 for weeks while price keeps rising, so the bands are only informative in a market that is genuinely ranging.
Why does the stochastic oscillator fail in a trend?
+Because closing near the top of the recent range is exactly what a healthy uptrend does every single day, and that is the only thing the indicator measures. The lowest low in the denominator is anchored roughly N bars back, so as the trend extends the high the low stays put and even a shallow pullback leaves the close high in the range. %K therefore pins above 80 and stays there while price marches on. Chartists call this embedding. Reading it as a sell signal is the most expensive misuse of the tool, because it means selling into strength repeatedly.
What is stochastic divergence, and can you trade it?
+Divergence is when price makes a new extreme but the stochastic does not: price prints a higher high while the oscillator prints a lower high. It happens when each new high is sold into, so the close finishes further below the high of the day, and %K reads the close. Lane regarded it as the most meaningful reading the tool gives. It is still a hypothesis rather than a signal: divergence can persist for months, printing again and again while price grinds higher, and each repetition is a warning that was early. It tells you what to look for, not when to act.
What is a good look-back period for the stochastic oscillator?
+The default is 14 periods, and other common choices are 5 and 9. A shorter look-back reacts faster and whipsaws more; a longer one is smoother and slower. The number is a study choice, not a setting that makes the tool more accurate, and it always describes only the range of the timeframe you apply it to: a reading on a 5-minute chart reflects a few hours, a daily reading on an Indian equity reflects roughly three trading weeks.
Why does the stochastic swing wildly in a quiet market?
+Because the recent range is the denominator, so the size of that range sets how much one close is worth. In a coiled market the range is small, and a modest move is a large fraction of it, so %K travels a long way. In a wide, volatile market the same move is a small fraction of a big range and barely registers. A 20 point close can be worth 36 points of %K in a coil and 8 points in a swingy market. The indicator is not more sensitive on some days; it is rescaling itself to whatever range it just measured.
Is the stochastic oscillator better than RSI?
+They answer different questions and share the same weakness. RSI compares the size of recent gains to the size of recent losses; the stochastic ignores size entirely and asks only where the close finished in its range. Both are bounded from 0 to 100, both carry overbought and oversold bands, and both pin at one end during a strong trend for the same underlying reason: their bands assume price is oscillating rather than trending. Neither is better in the abstract, and choosing between them matters far less than knowing which regime you are in.
Where the facts come from
Sources
- Origin and definition. The stochastic oscillator was developed by George C. Lane in the late 1950s and shows the location of the close relative to the high-low range over a set period; %K is the main line and %D is its 3-period average. en.wikipedia.org
- Fast, slow and full, and embedding. The slow stochastic applies an extra 3-period smoothing to %K, and a security can become and stay overbought during a strong uptrend: a stochastic that stays above 80 for a long time signals high momentum, not an imminent short. chartschool.stockcharts.com
- Lane on divergence. In working with %D, Lane held that the one valid signal is a divergence between %D and the security, with all other cues acting as warnings; divergence indicates momentum is waning and a reversal may be forming. en.wikipedia.org
- Indian retail derivatives outcomes. About 93% of individual traders in equity derivatives made net losses over FY22 to FY24, with aggregate net losses exceeding ₹1.8 lakh crore. sebi.gov.in, September 2024. Verify the current position at source before relying on it.
- Default parameters. The standard look-back is 14 periods with 3-period smoothing, and other common look-backs are 5 and 9; readings above 80 and below 20 are the conventional overbought and oversold zones.