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 risesShortStochastic %K falls
- LongStochastic %K fallsShortStochastic %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 upShortStochastic %K turns down
- LongStochastic %K turns downShortStochastic %K turns up
Settings
| Settings | Default | Range |
|---|---|---|
| %K | 5 | 2 – 50 |
| %D | 3 | 1 – 20 |
| Slowing | 3 | 1 – 20 |
| Level | 20 | 5 – 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
- Entry · Stochastic Oscillator (5, 3, 3): Stochastic %K rises
- Stop-loss 300 points, take-profit 600 points
- 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
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.