Stochastic RSI
Stochastic RSI takes RSI - already a bounded 0-100 momentum measure - and runs it back through the stochastic formula: (RSI - lowest RSI over the window) divided by (highest RSI - lowest RSI over the window), scaled to 0-100. The result is far more sensitive than plain RSI, since it measures where the current RSI sits relative to its own recent range rather than relative to a fixed 0-100 scale, so it reaches its own extremes more often and sooner. RSI itself is computed with Wilder's standard recursive smoothing (the conventional RSI definition), which does carry state forward bar to bar. The stochastic stage applied on top of it is a plain fixed-window highest/lowest scan with no further recursion, and both %K and %D are simple moving averages layered on top of that raw value, matching the commonly published construction. Notes and limitations - Needs roughly InpRsiPeriod + InpStochPeriod + InpKSmoothing + InpDSmoothing bars of history before both lines start plotting. - The RSI stage is recomputed across the visible range on every call rather than tracked as a running incremental value, so a chart history reload cannot leave stale smoothing state behind. - This is an oscillator only - no alerts, no trade signals.
Indicator · MT4 · v1.0 · Free
About Stochastic RSI
Stochastic RSI is an indicator for MetaTrader 4. It has 4 settings, such as Rsi period, Stoch period and K smoothing. MQL source code included.
Files in the download: StochasticRsi.mq4, StochasticRsi.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Rsi period | 14 | Wilder RSI period feeding the stochastic stage |
| Stoch period | 14 | Lookback window for the highest/lowest RSI scan |
| K smoothing | 3 | SMA smoothing applied to raw %K |
| D smoothing | 3 | SMA period for %D (SMA of smoothed %K) |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: RSI · Stochastic · Momentum · MT4 Indicator · MQL4 Source Code