What the stochastic oscillator measures, and what it does not
The stochastic oscillator answers one question: compared with the highs and lows of the latest candles, where did the market just close? At the very top of that range it reads 100. At the very bottom, 0. In the middle, 50. TradingView's help page on the Stochastic describes it this way: it displays the location of the close compared with the high-low range over a number of periods chosen by the user.
StockCharts' ChartSchool gives the simplest example: highest high of the period at 110, lowest low at 100, close at 108. The close sits 8 tenths of the way up the range, and the stochastic reads 80. Above 50, the close is in the upper half of the range; below 50, in the lower half.
So it measures neither the price level nor volume. A stochastic at 90 does not mean the market is expensive: it means the latest close is near the highest high of the latest candles, which happens candle after candle in a sustained rise. StockCharts and TradingView credit it to George Lane, in the late 1950s for the former, in the 1950s for the latter. For Lane, quoted by StockCharts, the indicator follows the speed of price, its momentum, which as a rule changes direction before price does. That is its author's idea, not a law: the diagram below shows a case where it is not enough. Pages consulted in October 2026.
Calculating %K and %D: fast, slow and full stochastics
The stochastic oscillator plots two lines. The first, %K, is the measurement itself: %K = (close − lowest low of the last N candles) ÷ (highest high of the last N candles − lowest low of the last N candles) × 100. The highest high and the lowest low are taken over the last N candles, the latest one included. TradingView, StockCharts and MetaTrader 5's help page on the Stochastic Oscillator write the same formula.
The second, %D, is a simple moving average of %K, over 3 periods by default. StockCharts presents it as the signal line, plotted alongside %K.
StockCharts distinguishes three versions. The fast stochastic uses Lane's original formulas: raw %K, and %D as its 3-period simple average. The slow stochastic first smooths %K with a 3-period simple average, then calculates %D on that smoothed %K: the slow %K is therefore exactly the fast %D. The full stochastic is a slow one whose three numbers can be set: the look-back window, the smoothing of %K and the period of %D.
Platforms do not all do that smoothing the same way. TradingView takes the simple average of the raw %K values, like StockCharts: its 'Smooth' setting is 3 by default, and setting it to 1 turns the smoothing off. MetaTrader 5 calls that setting 'Slowing', and the Stochastic indicator code published by MetaQuotes, its developer, does not average the %K values: it adds up the distances between close and lowest low over the last 3 candles, then divides by the sum of their ranges. As soon as the range changes from one candle to the next, the two calculations can give two different numbers. MetaTrader 5 also lets you choose the average used for %D: simple, exponential, smoothed or weighted.
The stochastic worked by hand on seven candles
The prices are invented, and the window is set to 5 periods instead of 14 so that the calculation fits in seven candles. The method is unchanged.
Here are the seven candles, in the order high, low, close. Candle 1: 101.50, 100.50, 101.00. Candle 2, a wide bullish candle: 105.50, 100.00, 105.20. Candle 3: 107.00, 105.00, 106.50. Candle 4: 108.50, 106.00, 108.00. Candle 5: 110.00, 107.50, 109.00. Candle 6: 109.50, 106.50, 107.00. Candle 7: 107.50, 105.50, 106.00.
At candle 5, the window covers candles 1 to 5. The highest high of the five is 110.00, the lowest low 100.00, the one from candle 2. The range is 10.00 and the close, 109.00, is 9.00 above the lowest low: %K = 9.00 ÷ 10.00 × 100 = 90.
At candle 6, the window slides to candles 2 to 6. Highest high 110.00, lowest low 100.00, close 107.00: %K = 7.00 ÷ 10.00 × 100 = 70.
At candle 7, candle 2 drops out of the window, and its low at 100.00 goes with it. Over candles 3 to 7 the highest high is still 110.00 but the lowest low rises to 105.00: the range is now only 5.00. The close, 106.00, is 1.00 above the lowest low: %K = 1.00 ÷ 5.00 × 100 = 20. Between candles 6 and 7, price lost only 1.00 and %K lost 50 points. The stochastic moves when price moves, and also when an old candle leaves the window.
%D, the simple average of the last three %K values: (90 + 70 + 20) ÷ 3 = 60. That is the fast stochastic's %D at candle 7, and it is also the slow stochastic's %K as TradingView and StockCharts calculate it.
With the calculation in the MetaQuotes code, %K slowed over 3 candles is (9.00 + 7.00 + 1.00) ÷ (10.00 + 10.00 + 5.00) × 100 = 17.00 ÷ 25.00 × 100 = 68. Same series, same setting, two values: 60 on one side, 68 on the other.
Stochastic settings, platform by platform
A stochastic oscillator is set with three numbers: the %K window, the smoothing of %K and the period of %D. The defaults are not the same everywhere.
TradingView: K 14, D 3, Smooth 3, in other words a slow stochastic, with two bands at 80 and 20. StockCharts: fast (14, 3), slow (14, 3) and full (14, 3, 3). MetaTrader 5: its help page gives no default, but the indicator published by MetaQuotes is set to 5, 3, 3, with two levels at 20 and 80. Between TradingView's setting and that of the MetaQuotes indicator, the window goes from 14 candles to 5: before comparing two lines, compare their three numbers.
The window sets how jumpy the line is. StockCharts sums it up: a short look-back period gives a choppy oscillator with many overbought and oversold readings; a long one, a smoother oscillator with fewer of them. None of these sources names a best setting: it depends, StockCharts writes, on personal preferences, trading style and timeframe.
Reading the stochastic: 80 and 20, crossovers, divergence
The 80 and 20 levels. Above 80, convention calls the market 'overbought'; below 20, 'oversold'. These are traditional thresholds that anyone can adjust, StockCharts writes, and both words are misleading: an overbought reading is not necessarily bearish, because a security can become overbought and stay overbought during a strong uptrend. TradingView says the same: these conditions can be the sign of a strengthening trend, not of an impending reversal. The diagram above is one such case: %K stays above 80 for fifteen candles, and price closes higher eleven times in a row after it enters the zone.
Both sources therefore advise reading the stochastic in the direction of the bigger trend: in an uptrend, look at the dips below 20 and set aside the moves above 80, and the reverse in a downtrend. StockCharts adds that these oscillators are best suited to markets with no direction.
The %K and %D crossover. MetaTrader 5's help lists among the popular readings %K rising above %D, read as bullish, and %K falling below it, read as bearish. StockCharts warns that these crossovers, like the moves back through 80 and 20, are frequent and prone to whipsaw.
Divergence. Bullish divergence: price makes a lower low, the stochastic a higher low. Bearish divergence: price makes a higher high, the stochastic a lower high. According to StockCharts, this was the first signal Lane identified, and the most important one. Yet the same page asks for a confirmation before drawing a conclusion: the stochastic crossing to the other side of 50, or a break of support or resistance on the price chart.
None of these three readings is an order to buy or sell. They are conventions, to be tested on your market, your timeframe and your setting, with the method in the article on how to backtest a trading strategy. Tradoshi does not calculate the stochastic, your charting platform displays it. The journal is for the next step: you tag every trade taken on one precise reading, for example '%K back above 20', and the dashboard filters by tag to show what that reading produced for you.
The Stochastic Momentum Index (SMI)
The Stochastic Momentum Index, or SMI, is a variant of the stochastic oscillator. TC2000's help page on the Stochastic Momentum Index states that it was introduced by William Blau in the January 1993 issue of Technical Analysis of Stocks & Commodities magazine, and the magazine's archive of William Blau's articles does list, at that date, an article titled 'Stochastic Momentum'. Its synopsis gives the principle: smooth twice both the numerator and the denominator of the %K formula.
Three things change compared with the stochastic oscillator. The close is no longer set against the bottom of the range but against its midpoint. The scale runs from −100 to +100: a positive value means the close is above the midpoint of the range, a negative value that it is below. And the result is smoothed twice with exponential moving averages, where the stochastic uses simple ones. TradingView's help page on the Stochastic Momentum Index, TC2000's and thinkorswim's documentation on the StochasticMomentumIndex agree on the midpoint and on the scale; TradingView and TC2000 give the double-smoothing formula.
The calculation, as TradingView writes it. Distance = close − (highest high of N candles + lowest low of N candles) ÷ 2. Range = highest high of N candles − lowest low of N candles. Then SMI = 200 × (distance smoothed twice) ÷ (range smoothed twice), each smoothing being an exponential moving average. The 200 comes from comparing the distance with half the range. TC2000 gives the same formula.
With no smoothing at all, the SMI is just a rescaled stochastic: SMI = 2 × %K − 100. In the example above, the %K values of 90, 70 and 20 become +80, +40 and −60. What really sets the SMI apart is therefore the double smoothing, applied separately to the distance and to the range.
It is read around zero and two levels, +40 and −40. TC2000 writes that the SMI is traditionally considered overbought above +40 and oversold below −40, and thinkorswim puts its levels at the same values. TradingView also draws its lines at 40 and −40, but adds another reading: above 40, a sign often interpreted as a bullish trend; below −40, as a bearish one. The same number is therefore read in two opposite ways, like the stochastic's 80.
Settings differ here too: TradingView offers a 10-period window and a smoothing of 3, the same for both averages, while TC2000 lets you set the two separately. All three platforms plot next to the SMI its exponential average, which serves as a signal line. TradingView presents the SMI as a version designed to limit false swings: none of the pages read puts a figure on that gain, and it is to be tested like everything else.
The limits of the stochastic oscillator
It does not give the direction of the trend. It places the close within a recent range, nothing more. In a strong trend it stays pinned to one of the two zones, and reading that as the announcement of a reversal amounts to betting against the move in progress.
It depends on its window and on the platform. In the example, %K lost 50 points for a 1.00 pullback, because an old candle dropped out of the window. And depending on the screen, the window is 14 or 5 and the smoothing is not calculated the same way: a rule written on one platform does not carry over unchanged to another.
Its signals are numerous. Crossovers and moves out of a zone happen often. StockCharts advises against using it alone and recommends checking it against volume, support and resistance, and breakouts.
It does not add up with other oscillators. The stochastic and the RSI belong to the same family, momentum oscillators: seeing them agree is not a double confirmation, as the page on technical analysis explains. Volatility is another question, the one the ATR lesson covers.
Frequently asked questions
What is the stochastic oscillator in trading?
The stochastic oscillator is a technical indicator that places the latest close within the range between the highest high and the lowest low of the last N candles, on a scale from 0 to 100. It is made of two lines: %K, the measurement, and %D, its moving average. George Lane developed it in the 1950s.
How is the stochastic oscillator calculated?
%K = (close − lowest low of the last N candles) ÷ (highest high − lowest low of the last N candles) × 100. %D is the simple moving average of %K, over 3 periods by default. In the slow version, %K is first smoothed with a 3-period simple average.
What is the best stochastic setting?
None is best in absolute terms. TradingView defaults to 14, 3, 3, StockCharts to 14, 3 or 14, 3, 3, and the indicator published by MetaTrader 5's developer is set to 5, 3, 3. A short window reacts faster and produces more overbought and oversold readings, a long window is smoother.
What do 80 and 20 mean on the stochastic?
They are the traditional thresholds of the so-called overbought and oversold zones. Above 80, the close is near the highest high of the window; below 20, near the lowest low. It is not a reversal signal: in a strong trend the stochastic can stay in one of those zones for a long time.
What is the Stochastic Momentum Index?
The Stochastic Momentum Index (SMI) is a variant of the stochastic oscillator introduced by William Blau in January 1993. It sets the close against the midpoint of the high-low range instead of its low, smooths the result twice with exponential averages and is plotted from −100 to +100, with usual levels at +40 and −40.
Key takeaways
- The stochastic oscillator places the close within the high-low range of the last N candles, from 0 to 100. It says neither the price level nor the direction of the trend.
- %K = (close − lowest low) ÷ (highest high − lowest low) × 100, and %D is its 3-period simple average. The slow stochastic smooths %K before calculating %D.
- Defaults differ: 14, 3, 3 on TradingView, 5, 3, 3 for the MetaQuotes indicator, and the smoothing of %K is not calculated the same way there.
- 80 and 20 are conventions. In a strong trend the stochastic stays overbought or oversold while price keeps going.
- The Stochastic Momentum Index sets the close against the midpoint of the range, smooths twice and runs from −100 to +100. Without smoothing it equals 2 × %K − 100.
Going further
These blog articles dig into this lesson's ideas, one subject per article.