On this page
- What is the stochastic oscillator?
- The stochastic formula
- Worked example
- Stochastic indicator settings on MT5
- Common stochastic indicator settings
- How to read %K and %D
- Overbought and oversold: what they really mean
- Fast, slow and full stochastic
- Stochastic RSI: how it differs
- Stochastic oscillator strategy 1: trend pullback
- Example: EUR/USD (H1)
- Stochastic oscillator strategy 2: stochastic divergence
- Example: gold (H4)
- Stochastic oscillator strategy 3: range trading
- Best timeframes and sessions for the stochastic
- Common stochastic mistakes
- Stochastic with other tools
- 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.
| Feature | Stochastic oscillator | RSI |
|---|---|---|
| What it compares | Close vs high–low range of N periods | Average gains vs average losses |
| Scale | 0 to 100 | 0 to 100 |
| Standard levels | 80 and 20 | 70 and 30 |
| Lines | Two (%K and %D) | One |
| Speed | Faster, more signals | Smoother, 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.
- %K = (Current close – Lowest low of N periods) ÷ (Highest high of N periods – Lowest low of N periods) × 100.
- %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.
| Item | Value |
|---|---|
| Highest high of last 5 candles | 1.1660 |
| Lowest low of last 5 candles | 1.1600 |
| Range | 60 pips |
| Current close | 1.1648 |
| Close minus lowest low | 48 pips |
| %K | 48 ÷ 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.
- Open MT5 and log in (server Xellion-Live). Our MT5 download, login and setup guide covers installation on Android, iPhone, PC and web.
- Go to Insert → Indicators → Oscillators → Stochastic Oscillator. On mobile, tap the indicator (f) icon and choose Stochastic Oscillator.
- Set %K period, %D period and slowing. The MT5 default is 5, 3, 3.
- Choose the price field (Low/High is standard) and the moving average method (Simple is standard).
- Check the Levels tab: 80 and 20 are standard.
- Save the chart as a template.
Common stochastic indicator settings
| Settings (%K, %D, slowing) | Behaviour | Typical use |
|---|---|---|
| 5, 3, 3 | Fast, many signals | MT5 default; short-term charts |
| 14, 3, 3 | Smoother, fewer signals | Very common on other platforms; H1 to D1 |
| 21, 7, 7 | Slow, filters noise | Swing 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
| Version | How it works | Notes |
|---|---|---|
| Fast stochastic | Raw %K plus a 3-period %D | Very jumpy; rarely used alone |
| Slow stochastic | %K smoothed by 3, then %D of that | The standard view; MT5 slowing = 3 |
| Full stochastic | You choose %K, slowing and %D freely | MT5'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.
- Define the trend with a higher-timeframe tool, for example price above the 50 EMA on H4. See our moving average trading guide.
- Drop to H1. Wait for a pullback that pushes the stochastic below 20.
- Wait for %K to cross back above %D and both to rise above 20.
- Confirm with a bullish candle near a support area.
- 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.
| Item | Level | Calculation |
|---|---|---|
| Entry | 1.1614 | Close of the signal candle |
| Stop-loss level | 1.1596 | Below the pullback low |
| Planned loss | 18 pips | 1.1614 – 1.1596 |
| Target | 1.1650 | Previous swing high |
| Distance to target | 36 pips | About 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.
| Item | Level | Calculation |
|---|---|---|
| Entry | $4,098 | Close of the engulfing candle |
| Stop-loss level | $4,116 | Above the new high |
| Planned loss per ounce | $18 | $4,116 – $4,098 |
| Target | $4,062 | Previous pullback low |
| Distance to target | $36 | About 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.
- Mark the range high and low on H1 or H4.
- Near the range low, wait for the stochastic to fall below 20 and %K to cross up through %D.
- Buy with the stop-loss level below the range low; target the middle or top of the range.
- 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
| Mistake | What happens | Better approach |
|---|---|---|
| Selling every reading above 80 | Repeated losses in uptrends | Trade with the trend; use pullbacks |
| Acting on every %K/%D cross | Too many low-quality trades | Only take crosses in the extreme zones, with trend |
| Trusting divergence alone | Entering too early | Wait for a price trigger |
| Using the MT5 default 5,3,3 everywhere | Noisy signals on low timeframes | Test 14,3,3 or slower |
| No stop-loss level | One trend day wipes out many small wins | Set 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:
- Choose an account on the accounts page: Standard (minimum $50), Raw (minimum $250) or Zero (minimum $750).
- Fund it on the funding page: UPI deposits are instant, from $50.
- 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.


