Risk warning: CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. Risk disclosure
Education10 min read

Stochastic oscillator guide: settings, %K and %D, and how traders use it

Learn the stochastic oscillator: the formula, %K and %D lines, MT5 stochastic indicator settings, overbought and oversold signals and strategy examples.

Stochastic oscillator below an EUR/USD H1 chart with %K crossing above %D under 20 during a pullback (example prices)
On this page
  1. What is the stochastic oscillator?
  2. The stochastic formula
  3. Worked example
  4. Stochastic indicator settings on MT5
  5. Common stochastic indicator settings
  6. How to read %K and %D
  7. Overbought and oversold: what they really mean
  8. Fast, slow and full stochastic
  9. Stochastic RSI: how it differs
  10. Stochastic oscillator strategy 1: trend pullback
  11. Example: EUR/USD (H1)
  12. Stochastic oscillator strategy 2: stochastic divergence
  13. Example: gold (H4)
  14. Stochastic oscillator strategy 3: range trading
  15. Best timeframes and sessions for the stochastic
  16. Common stochastic mistakes
  17. Stochastic with other tools
  18. Practise the stochastic oscillator with Xellion

The stochastic oscillator is a momentum indicator that shows where the latest closing price sits inside the recent high–low range. If price closes near the top of the range, the stochastic is high. If it closes near the bottom, the stochastic is low. It moves between 0 and 100 and is drawn as two lines, %K and %D, in a window below the chart.

The stochastic indicator is one of the oldest and most widely used oscillators, and it is a standard indicator on MetaTrader 5. Many Indian beginners first meet it as "the indicator that shows overbought and oversold". That is part of the story, but used alone in that way it gives many false signals. This guide explains the stochastic formula with a worked example, the stochastic indicator settings on MT5, how to read %K and %D, the difference between fast, slow and full stochastic, how stochastic RSI differs, and three stochastic oscillator strategy setups with example prices.

What is the stochastic oscillator?

The stochastic oscillator was popularised by George Lane in the 1950s. His idea was simple: in an uptrend, prices tend to close near the top of their recent range; in a downtrend, they tend to close near the bottom. When that habit starts to change, momentum may be slowing.

FeatureStochastic oscillatorRSI
What it comparesClose vs high–low range of N periodsAverage gains vs average losses
Scale0 to 1000 to 100
Standard levels80 and 2070 and 30
LinesTwo (%K and %D)One
SpeedFaster, more signalsSmoother, fewer signals

Because it reacts quickly, the stochastic is popular for timing entries within a trend that another tool has already identified. Our RSI indicator guide covers the slower cousin in detail.

The stochastic formula

The calculation has two parts.

  1. %K = (Current close – Lowest low of N periods) ÷ (Highest high of N periods – Lowest low of N periods) × 100.
  2. %D = a moving average of %K, usually over 3 periods.

A third setting, slowing, smooths %K itself before %D is calculated. This produces the "slow stochastic" that most platforms show by default.

Worked example

All figures are example figures for EUR/USD with a 5-period lookback.

ItemValue
Highest high of last 5 candles1.1660
Lowest low of last 5 candles1.1600
Range60 pips
Current close1.1648
Close minus lowest low48 pips
%K48 ÷ 60 × 100 = 80

A reading of 80 means the close is 80% of the way up the recent range. If the next two %K values are 74 and 68, %D (the 3-period average) is (80 + 74 + 68) ÷ 3 = about 74.

Stochastic indicator settings on MT5

The stochastic oscillator is built into MT5, so nothing needs to be downloaded.

  1. Open MT5 and log in (server Xellion-Live). Our MT5 download, login and setup guide covers installation on Android, iPhone, PC and web.
  2. Go to Insert → Indicators → Oscillators → Stochastic Oscillator. On mobile, tap the indicator (f) icon and choose Stochastic Oscillator.
  3. Set %K period, %D period and slowing. The MT5 default is 5, 3, 3.
  4. Choose the price field (Low/High is standard) and the moving average method (Simple is standard).
  5. Check the Levels tab: 80 and 20 are standard.
  6. Save the chart as a template.

Common stochastic indicator settings

Settings (%K, %D, slowing)BehaviourTypical use
5, 3, 3Fast, many signalsMT5 default; short-term charts
14, 3, 3Smoother, fewer signalsVery common on other platforms; H1 to D1
21, 7, 7Slow, filters noiseSwing trading on H4 and D1

There is no single best setting. If your stochastic flips between 80 and 20 every few candles, lengthen the %K period. If it barely reaches the levels, shorten it. Test settings on a demo account across a few weeks of charts before trading them live.

How to read %K and %D

  • %K (main line) – the faster line, usually drawn solid.
  • %D (signal line) – the moving average of %K, usually drawn dotted. It is slower.
  • Crossovers – %K crossing above %D suggests upward momentum is picking up; %K crossing below %D suggests it is fading.
  • Above 80 – the close is near the top of the recent range.
  • Below 20 – the close is near the bottom of the recent range.
  • The 50 line – above 50, closes are in the upper half of the range; below 50, the lower half.

Overbought and oversold: what they really mean

"Overbought" above 80 does not mean price must fall. It means price has been closing near the highs. In a strong uptrend, the stochastic can stay above 80 for a long time while price keeps rising. Selling every move above 80 in that trend produces repeated losses.

A more useful rule for overbought and oversold readings:

  • In an uptrend, ignore overbought readings and look for buys when the stochastic dips into oversold and turns back up.
  • In a downtrend, ignore oversold readings and look for sells when it rises into overbought and turns back down.
  • In a range, both extremes can be used, near clear support and resistance levels.

Fast, slow and full stochastic

VersionHow it worksNotes
Fast stochasticRaw %K plus a 3-period %DVery jumpy; rarely used alone
Slow stochastic%K smoothed by 3, then %D of thatThe standard view; MT5 slowing = 3
Full stochasticYou choose %K, slowing and %D freelyMT5's settings box is effectively a full stochastic

On MT5, setting slowing to 1 gives the fast stochastic, and slowing 3 gives the slow stochastic.

Stochastic RSI: how it differs

Stochastic RSI applies the stochastic formula to RSI values instead of price. It asks: where is today's RSI inside its own recent high–low range?

  • It moves much faster than either RSI or the normal stochastic.
  • It reaches 0 and 100 often, so it gives many more signals.
  • It is not one of the standard MT5 indicators; traders who want it install a custom version from the MetaTrader Market or MQL5 code base.

For most beginners, the standard stochastic oscillator or RSI is easier to read. Stochastic RSI suits traders who already understand both.

Stochastic oscillator strategy 1: trend pullback

This is the most practical stochastic oscillator strategy because it trades with the trend.

  1. Define the trend with a higher-timeframe tool, for example price above the 50 EMA on H4. See our moving average trading guide.
  2. Drop to H1. Wait for a pullback that pushes the stochastic below 20.
  3. Wait for %K to cross back above %D and both to rise above 20.
  4. Confirm with a bullish candle near a support area.
  5. Buy on the close. Place the stop-loss level below the pullback low.

Example: EUR/USD (H1)

All prices are example prices.

  • EUR/USD is above its rising 50 EMA on H4.
  • During the London session, price pulls back to 1.1605 and the H1 stochastic drops to 12.
  • At 3:30 pm IST, %K crosses above %D and both lines move above 20. The candle closes at 1.1614.
ItemLevelCalculation
Entry1.1614Close of the signal candle
Stop-loss level1.1596Below the pullback low
Planned loss18 pips1.1614 – 1.1596
Target1.1650Previous swing high
Distance to target36 pipsAbout 2:1

To set the stop distance by volatility instead of swing points, see the ATR indicator guide.

Stochastic oscillator strategy 2: stochastic divergence

Stochastic divergence happens when price and the oscillator disagree.

  • Bearish divergence: price makes a higher high, but the stochastic makes a lower high. Upward momentum is weakening.
  • Bullish divergence: price makes a lower low, but the stochastic makes a higher low. Downward momentum is weakening.

Divergence is a warning, not an entry. Many traders wait for a trigger, such as a break of a short-term trendline or a reversal candle from our candlestick patterns guide.

Example: gold (H4)

All prices are example prices.

  • Gold rallies to $4,095, pulls back, then pushes to a new high at $4,110.
  • The stochastic peaked at 92 on the first high but only 78 on the second – bearish divergence.
  • A bearish engulfing candle closes at $4,098.
ItemLevelCalculation
Entry$4,098Close of the engulfing candle
Stop-loss level$4,116Above the new high
Planned loss per ounce$18$4,116 – $4,098
Target$4,062Previous pullback low
Distance to target$36About 2:1

On most MT5 accounts, 1 lot of gold is 100 ounces, so at 0.01 lot each $1 move is worth about $1. An $18 stop at 0.01 lot is a planned loss of about $18, before costs.

Divergence also works well with harmonic patterns: many traders look for stochastic divergence at the pattern's completion point as extra confirmation.

Stochastic oscillator strategy 3: range trading

When a pair is clearly ranging, the stochastic's extremes become more useful.

  1. Mark the range high and low on H1 or H4.
  2. Near the range low, wait for the stochastic to fall below 20 and %K to cross up through %D.
  3. Buy with the stop-loss level below the range low; target the middle or top of the range.
  4. Reverse the logic at the range high.

The weakness: ranges end in breakouts. If price closes firmly outside the range, stop using range signals and look at trend tools instead, such as Bollinger Bands or the Ichimoku cloud.

Best timeframes and sessions for the stochastic

  • M30 and H1 – suit intraday traders following the London and New York sessions. In winter, London opens around 1:30 pm IST and New York around 6:30 pm IST.
  • H4 and D1 – fewer, cleaner signals for swing traders.
  • Early IST morning – the Asian session is often quiet on major pairs, so stochastic swings can be small and less meaningful.
  • Multiple timeframes – a simple routine is to check the stochastic on H4 for the bigger swing and on H1 for entry. When the H4 stochastic is rising from below 50 and the H1 stochastic turns up from below 20, both timeframes point the same way. When they disagree – for example H4 falling from above 80 while H1 gives a bullish signal – many traders skip the trade or wait for the higher timeframe to settle.
  • News times – a US data release, often at 7:00 pm IST in winter, can push the stochastic from 10 to 90 in one candle. Check the economic calendar before you trade.

Common stochastic mistakes

MistakeWhat happensBetter approach
Selling every reading above 80Repeated losses in uptrendsTrade with the trend; use pullbacks
Acting on every %K/%D crossToo many low-quality tradesOnly take crosses in the extreme zones, with trend
Trusting divergence aloneEntering too earlyWait for a price trigger
Using the MT5 default 5,3,3 everywhereNoisy signals on low timeframesTest 14,3,3 or slower
No stop-loss levelOne trend day wipes out many small winsSet the stop before entry

Stochastic with other tools

  • Trend filter: moving averages or the Ichimoku cloud decide direction; the stochastic times the entry.
  • Momentum check: compare with the MACD indicator. When both turn together, the signal is stronger.
  • Volatility: ATR sets the stop distance and lot size.

For the bigger picture, see our guide to technical analysis in forex.

Practise the stochastic oscillator with Xellion

The stochastic oscillator is a standard indicator on MetaTrader 5 (server Xellion-Live), and you can follow your positions on the Xellion app for iOS and Android or on WebTrader. A free demo account lets you test settings such as 5,3,3 and 14,3,3 and practise pullback and divergence setups with live prices and no real money.

When you are ready to go live:

  1. Choose an account on the accounts page: Standard (minimum $50), Raw (minimum $250) or Zero (minimum $750).
  2. Fund it on the funding page: UPI deposits are instant, from $50.
  3. Work out position sizing from the stop-loss level. Leverage goes up to 1:2000, which lowers the margin needed, but lot size decides what each pip is worth. See the lot size and pip calculator guide.

Scalping is not permitted on Xellion accounts, so use the stochastic on timeframes such as M30, H1 and H4 that give trades room to develop.

CFDs are complex instruments and carry a high risk of losing money. Not investment advice.

What is the stochastic oscillator?

The stochastic oscillator is a momentum indicator that shows where the latest close sits within the high–low range of a set number of periods. It runs from 0 to 100 and uses two lines, %K and %D.

What are the best stochastic indicator settings?

MT5 uses 5, 3, 3 by default. Many traders prefer 14, 3, 3 for smoother signals, and swing traders sometimes use 21, 7, 7. Test settings on a demo account first.

What do %K and %D mean?

%K is the main line showing the close's position in the range. %D is a moving average of %K and acts as the signal line. Crossovers between them are used as momentum signals.

Does stochastic above 80 mean sell?

Not by itself. Above 80 means price is closing near recent highs. In an uptrend it can stay there for a long time, so many traders only sell overbought readings in a downtrend or at range highs.

What is the difference between stochastic and stochastic RSI?

The stochastic applies its formula to price. Stochastic RSI applies the same formula to RSI values, so it moves faster and gives more signals.

Is the stochastic oscillator available on MT5?

Yes. It is under Insert, Indicators, Oscillators, Stochastic Oscillator. Stochastic RSI is not a standard MT5 indicator and needs a custom version.

Which timeframe is best for the stochastic indicator?

H1 and H4 suit most beginners because signals are cleaner. M30 suits intraday traders during the London and New York sessions.

This article is general information and education, not investment advice. CFDs are complex instruments and carry a high risk of losing money rapidly due to leverage.

Ready to put it into practice?
Open an account in minutes, or practise on a free demo first.

Risk warning: CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money. Blog articles are general information and education, not investment advice. Risk disclosure