Stochastic Oscillator
The stochastic oscillator is an indicator that shows where the latest close sits within the highest high and lowest low of a recent period, on a 0 to 100 scale.
The stochastic oscillator is an indicator that shows where the latest closing price sits within the highest high and lowest low of a recent period, on a scale from 0 to 100. A close at the top of that range reads 100; a close at the bottom reads 0.
Traders use it to time entries: readings above 80 are called overbought and readings below 20 oversold.
How is the stochastic oscillator calculated?
The stochastic oscillator takes the distance from the lowest low to the close, divides it by the full high-low range of the period, and multiplies by 100. That gives %K; %D is a moving average of %K, and slowing smooths %K first.
MetaTrader 5's Stochastic Oscillator help page gives the lines as:
- %K = (close − lowest low) ÷ (highest high − lowest low) × 100, over the %K period.
- %D = a moving average of %K, over the %D period. It is the slower, smoother line.
- Slowing smooths %K first: a value of 1 gives a fast stochastic, 3 a slow one.
Worked example: stochastic oscillator on USDZAR
Over the last 14 daily candles, USDZAR's highest high is 18.5000 and its lowest low is 18.2000. Today it closes at 18.2600.
| Step | Calculation | Result |
|---|---|---|
| Distance above the low | 18.2600 − 18.2000 | 0.0600 |
| Size of the range | 18.5000 − 18.2000 | 0.3000 |
| %K | 0.0600 ÷ 0.3000 × 100 | 20 |
A %K of 20 means the close is one fifth of the way up the 14-day range. MetaTrader 5's help uses 80 and 20 as example levels, and a reading at or below 20 is often called oversold. In a strong trend the reading stays near one end for days, so traders take stochastic timing in the trend's direction: in an uptrend, %K crossing back above %D from below 20 times a buy.
How is the stochastic different from RSI?
RSI compares the size of recent gains with recent losses, while the stochastic compares the latest close with the recent high-low range. Both run from 0 to 100 and both are momentum oscillators, so they often move together. The RSI and stochastic lesson compares them on the same chart.
Divergence between price and either indicator is explained separately.
How do traders read the stochastic oscillator?
Traders read the stochastic with the trend, with settings that match their timeframe, and with most weight on %K and %D crosses inside the 80 and 20 zones. Readings in the middle of the scale carry less weight. Each habit is explained below.
- With the trend. In an uptrend the close sits near the top of the range day after day, so traders use dips below 20 for timing buys rather than treating readings above 80 as sells.
- With settings to match the timeframe. A 5-period stochastic moves far more than a 21-period one on the same chart.
- Crosses in the zones. A %K cross of %D above 80 or below 20 carries more weight than one in the middle of the scale.
How do you add the stochastic in MetaTrader 5?
In MetaTrader 5 you add the stochastic from Insert, Indicators, Oscillators, Stochastic Oscillator, or by dragging it from the Navigator onto a chart. It draws in a separate window below the price chart. Set the %K period, %D period and slowing in its properties, as described in the indicators help.
What do traders often get wrong about the stochastic?
The common mistake is reading a stochastic above 80 as a sign that price is about to fall. It means the close is near the top of the recent range, which is normal in a rising market. Traders wait for %K to cross below %D and the reading to drop back under 80 before treating it as sell timing.
Sources
- MetaQuotes, MetaTrader 5 Help: Stochastic Oscillator, accessed 19 October 2026: %K and %D lines, the %K formula, %D as a moving average of %K, slowing of 1 (fast) or 3 (slow), and 80 and 20 as example levels. https://www.metatrader5.com/en/terminal/help/indicators/oscillators/so
- MetaQuotes, MetaTrader 5 Help: Technical Indicators, accessed 19 October 2026: indicators are added by dragging from the Navigator or with Insert, Indicators; oscillators draw in a separate window; settings change through Properties. https://www.metatrader5.com/en/terminal/help/charts_analysis/indicators
Practise what you learned
Open an account to use MetaTrader 5. Start on a demo account before risking real money.
Open Account