Skip to content
72lab

Stochastic Oscillator EA: no-code builder for MT4 / MT5

OscillatorsThe Stochastic Oscillator shows where the close sits in the recent high–low range, from 0 to 100. Below 20 is oversold and above 80 is overbought. That makes it useful for spotting reversals in ranging markets.

Rules you can build with it

Works as an entry rule or an exit rule. Short rules are mirrored automatically.

  • LongStochastic %K rises
    ShortStochastic %K falls
  • LongStochastic %K falls
    ShortStochastic %K rises
  • LongStochastic %K is above 20(adjustable level)
    ShortStochastic %K is below 80
  • LongStochastic %K is below 20(adjustable level)
    ShortStochastic %K is above 80
  • LongStochastic %K crosses above 20(adjustable level)
    ShortStochastic %K crosses below 80
  • LongStochastic %K crosses below 20(adjustable level)
    ShortStochastic %K crosses above 80
  • LongStochastic %K turns up
    ShortStochastic %K turns down
  • LongStochastic %K turns down
    ShortStochastic %K turns up

Settings

SettingsDefaultRange
%K52 – 50
%D31 – 20
Slowing31 – 20
Level205 – 95

How the backtest and the EA calculate it

%K has a “Slowing” parameter, %D is a simple average of %K, and the high/low range uses each candle's High and Low: the same settings as MT5's Stochastic Oscillator.

Signals use only closed candles and are filled at the next candle's open. The exported EA checks conditions in the same order, so you get similar results in the MT5 Strategy Tester.

Example strategies

Example 1
  • Entry · Stochastic Oscillator (5, 3, 3): Stochastic %K rises
  • Stop-loss 300 points, take-profit 600 points
Open in the EA Workshop
Example 2
  • Entry · Stochastic Oscillator (5, 3, 3): Stochastic %K rises
  • Entry · Moving Average (50, EMA, Close): MA rises
  • Stop-loss 300 points, take-profit 600 points
Open in the EA Workshop

Examples are just a starting point: open one to change settings or add filters, then check it with backtests and robustness tests. Backtest results don't indicate future returns.