Stoch RSI Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

Stoch RSI asks where RSI sits within its own recent range. The stoch RSI indicator takes a 14-bar RSI, finds its highest and lowest values over fourteen bars, and places the current reading between them from 0 to 100. It then smooths %K and %D and marks crosses near the edges.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Separate window (levels 20 / 50 / 80)
Plots 4: %K, %D, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 13

On screen

Two lines and two marks in a pane.

`%K` traces dodger blue at width 2.

`%D` traces orange red at width 1.

`Buy` sits on %K in lime.

`Sell` sits on %D in red.

Guides sit at 20, 50 and 80.

  • %K: line, dodger blue, width 2
  • %D: line, orange red, width 1
  • Buy: arrow, lime, width 2, arrow code 233
  • Sell: arrow, red, width 2, arrow code 234
stoch rsi indicator: Stoch RSI pane with edge crosses, EURUSD H1.
Stoch RSI pane with edge crosses, EURUSD H1.

Inside the calculation

The RSI

`RsiPeriod` `14` uses Wilder’s averaging of gains and losses.

The stochastic

`StochPeriod` `14` finds the RSI’s high and low. Where RSI sits between them is the raw value, and `SmoothK` `3` averages it into %K.

The marks

`SmoothD` `3` averages %K into %D. A cross up with %K under 25 prints a buy; a cross down with %K over 75 prints a sell.

Reading the output

Near 100 means RSI is at the top of its range.

Near 0 means it is at the bottom.

The lines move much faster than RSI.

Mid-pane crosses stay unmarked.

`SignalGap` `3` spaces same-side marks.

Warm-up needs about thirty bars.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

Edge crosses of %K and %D each send one message. `EnableAlerts` turns them on or off, and at first only the popup is set to deliver them.

Every Stoch RSI Indicator input

Core settings

Setting What it does Default
RsiPeriod RSI length. RSI length, `14`. 14
StochPeriod Stochastic length (over RSI). Stochastic window over RSI, `14`. 14
SmoothK %K smoothing. %K smoothing, `3`. 3
SmoothD %D smoothing. %D smoothing, `3`. 3
OverBought Overbought level. Upper guide, `80.0`. 80.0
OverSold Oversold level. Lower guide, `20.0`. 20.0
SignalGap Min bars between arrows. Minimum spacing for repeat marks, `3`. 3

Alert settings

Setting What it does Default
EnableAlerts Switch for cross messages, `true`. on
EnablePopup Popup, `true`. on
EnablePushNotify (see inputs panel) off
EnableEmail (see inputs panel) off
EnableSound Speaker, `false`. off
SoundFile (see inputs panel) alert.wav
stoch rsi indicator: Inputs panel, RSI and stochastic lengths together.
Inputs panel, RSI and stochastic lengths together.

Which chart to load it on

Stoch RSI swings fully several times a day on hourly charts. EURUSD H1 is the reference chart. On M5 it flips constantly. On D1 each edge cross marks a pullback within the larger move.

Honest weaknesses

It reaches the edges very often.

In trends it can pin at one edge.

Two layers of smoothing add lag.

Just the popup is live out of the box.

Copy the compiled Stoch RSI Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Background reading on the method behind the Stoch RSI Indicator: Stochastic RSI at Investopedia, StochRSI at StockCharts ChartSchool.

Download the Stoch RSI Indicator for MT4 and MT5

The zip holds the compiled Stoch RSI Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

How is Stoch RSI different from a plain stochastic?

A plain stochastic places price within its range. This one places RSI within its own range, so it reacts to changes in momentum rather than price.

Why does a Buy need %K under OverSold plus five?

The cross must start near the bottom edge. With the lower guide at 20, either %K reading on the cross must sit below 25, which keeps mid-range crosses off.

What does StochPeriod 14 measure?

The highest and lowest RSI values over the last fourteen bars. The current RSI is then expressed as a percentage of that range, which is why the line swings so widely.

Why does %K pin at 100 in strong trends?

When RSI keeps making new highs within its window, it stays at the top of its own range. The line sits at the edge until momentum eases.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Stoch RSI Indicator as one input. Always backtest before trading live.

Category: this is part of our Oscillators collection. Browse more Oscillators for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment