MT5 Stochastic: %K, %D and slowing explained

MT5 Stochastic: %K, %D and slowing explained

Stochastic measures location within a range

The Stochastic oscillator relates a close to a recent high–low range. A high value means the close is near the upper part of that range under the selected calculation. RSI instead compares upward and downward price changes. Their shared 0–100 scale does not make them equivalent.

Start with the raw relationship 100 × (close−lowest low)/(highest high−lowest low). The plotted MT5 values also depend on smoothing controls, so a hand calculation of the raw value may not match a slowed plot.

Keep the three controls separate

%K period defines the lookback used for the range. Slowing controls internal smoothing of %K. %D period controls the smoothing used for the signal line. The selected moving-average method and price field also affect the result.

When someone describes “5,3,3”, ask which field each number belongs to. Do not change all three at once and then attribute the result to a shorter lookback. Save the full input set with any example or test.

Calculate the unsmoothed value first

For a synthetic range with high=110, low=90 and close=105, raw %K is 75. If the close moves to 110 without a new high, it becomes 100. If a new high changes the range, both the numerator and denominator may change.

At a flat range, the denominator is zero. A custom implementation must define that case instead of producing an invalid number. When reproducing MT5's built-in output, verify its smoothing and edge behaviour rather than substituting a convenient flat value and claiming exact parity.

A high reading can persist

Levels such as 80 and 20 describe locations in the selected recent range. They do not establish that the current move is exhausted. A strong trend can repeatedly close near one edge, keeping the oscillator high or low.

Distinguish %K crossing %D, crossing a level, and remaining beyond a level. Use two eligible observations for a crossing and record whether they are closed-bar or intrabar values. A screenshot taken after the move cannot establish when the crossing first appeared.

Compare raw and smoothed responses

On one fixed interval, compare slowing=1 with a larger slowing value while keeping the other settings unchanged. Record event counts and delays at the same timestamps. Then compare RSI on those timestamps and explain why the values differ.

For an original range-position implementation without Stochastic smoothing, see the custom-indicator tutorial. Treat it as a teaching comparison, not a replacement claimed to match the built-in indicator.

Sources and further reading

Back to top

MQLume Bespoke

Built around your ambition.

Explore bespoke services →

Have something more specific in mind?

Ask us about advanced custom development. Share your requirements through private support or email; we will discuss the scope and quote separately.

100% committed to following up on your delivery and support requests.

Free downloads. Real source files.

FREE

Lizard [MQLume]

MQL5 / MT5Version v2.21

Free editable gold breakout project with six independently selectable cores, session filters and flexible position sizing.

US$149.00FREE
FREE

Scraper Gold [MQLume]

MQL5 / MT5Version v3.7

Free editable source with compiled EX5: four gold breakout engines with independent profiles, sizing, direction and exits.

US$95.00FREE
FREE

EA Black Dragon [MQLume]

MQL5 / MT5Version v13.0

Trend-based entries with optional grid additions, side controls and virtual exits.

US$30.00FREE
FREE

Hamster Scalping [MQLume]

MQL5 / MT5Version v21.0

RSI entries with two ATR filters, configurable sessions and optional grid management.

US$30.00FREE
MQLume

More to explore. A community to share it with.

Stay close to MQLume, wherever you like to learn.

YouTube

See our EAs in action. Explore backtests, walkthroughs and practical guides.

Watch on YouTube

Telegram

Meet other EA users, share ideas and keep up with what’s new.

Join the community Follow official updates

Cart

One personal-use licence per project. Each project can be added once.

Your cart is waiting for its first passenger.

Choose an EA or source edition to get started.

Continue shopping