Free MT5 RSI Research Indicator
Hidden-Markov RSI for MT5
RSI signals mean different things in bull, bear, panic, and sideways states.
Compiled file only. Install in MQL5/Indicators. Source code is not included.
What It Solves
Traders who want state probabilities around RSI instead of one fixed oscillator rule.
This is the "context brain" of the suite. It helps explain why the same RSI value can be bullish in one state, dangerous in another, and meaningless in chop.
Technical Method
The model refits on trailing historical observations and uses data through the prior bar for causal state estimation. Latent HMM states are mapped into readable market regimes, then RSI payoff functions are calculated per state and RSI bin.
How This Indicator Works In Practice
Hidden-Markov RSI is the regime layer of the suite. It learns four latent states from standardized return and realized volatility, then maps those states into readable Bull, Bear, Panic, and Sideways regimes. The indicator then evaluates RSI payoff inside each state.
This matters because RSI is context-sensitive. In a bull state, a high RSI can be continuation. In a panic state, a low RSI can still be dangerous. In a sideways state, classic mean-reversion logic may become more useful. Hidden-Markov RSI helps decide which RSI interpretation deserves trust.
Input Parameters Explained
| Input | Default | Meaning | Tuning Guidance |
|---|---|---|---|
InpRSIPeriod |
14 | RSI period used inside the state-specific payoff model. | Keep 14 for baseline. Use 21 for smoother swing state-payoff behavior. |
InpRSIPrice |
PRICE_CLOSE | Price source for RSI. | Close is best for consistency. |
InpRSIBins |
10 | Bins used for state-specific RSI payoff functions. | Fewer bins are robust; more bins require more samples. |
InpVolatilityPeriod |
20 | Rolling log-return volatility used by the HMM observation model. | 10-20 intraday, 30-50 swing. |
InpHMMTrainingBars |
600 | Trailing observations used for each HMM refit. | 400-600 adapts faster. 800-1200 is more stable. |
InpHMMMinTrainingBars |
250 | Minimum observations required before fitting. | Raise if you want fewer weak early states. |
InpRefitEveryBars |
25 | How often the HMM refits in walk-forward mode. | 10-15 adapts faster but costs more CPU. 25 default. 50 smoother. |
InpEMIterations |
12 | Maximum expectation-maximization iterations. | Keep default unless optimizing CPU. |
InpEMTolerance |
0.00010 | Convergence tolerance for EM fitting. | Smaller is stricter, larger is faster. |
InpVarianceFloor |
0.05 | Minimum variance for numerical stability. | Avoid changing unless model becomes unstable. |
InpTransitionPrior |
0.20 | Pseudo-count smoothing for state transitions. | Higher gives smoother transitions. |
InpInitialSelfTransition |
0.94 | Initial assumption that regimes persist. | Higher creates stickier states, lower allows faster switching. |
InpForwardHorizon |
5 | Bars ahead used for state-specific RSI payoff. | 3-5 intraday, 10-20 swing. |
InpUseLogForwardReturn |
true | Uses log returns for payoff. | Leave true for research consistency. |
InpMinEffectiveSamples |
20.0 | Minimum weighted samples for a state-RSI bin. | Raise to reduce noisy signals. |
InpPayoffShrinkage |
15.0 | Shrinks RSI-bin payoff toward the state mean. | Higher is conservative. Lower is more reactive. |
InpMinStateProbability |
55.0 | Minimum dominant-state probability required for signals. | 65-75 for high-confidence regime signals. |
InpMinExpectedReturnBps |
5.0 | Minimum expected payoff required. | Raise for fewer signals. |
InpMinAbsTStat |
0.75 | Minimum payoff t-stat. | 1.0-1.5 for conservative filtering. |
InpSignalMode |
SIGNAL_STATE_ENTRY_ONLY | Signals every qualifying bar or only state entry. | Entry-only is best for practical use. |
InpMaxCalculatedBars |
1000 | Maximum bars calculated. | Increase for research, reduce for speed. |
InpUpdateIntrabar |
false | Allows intrabar updates. | Keep false for speed and cleaner bar-close research. |
Parameter Ideas By Trader Type
Regime Filter
Use before taking any RSI signal from another indicator.
Suggested direction: Training 600, refit 25, state probability 55-65, entry-only.
Conservative Trader
Needs high regime confidence and stronger payoff evidence.
Suggested direction: Training 800-1200, state probability 70+, min samples 30-50, t-stat 1.0+.
Fast Intraday Trader
Wants regimes to adapt faster during active sessions.
Suggested direction: Training 400-600, refit 10-15, volatility period 14-20, max bars 700-1000.
These are research starting points, not guaranteed profitable presets. Test each symbol and timeframe with realistic spread, commission, slippage, and session filters before using any RSI signal in live trading.
Where It Fits In The RSI Stack
This indicator is part of the AlgoSpecial RSI Research Cluster: six MT5 indicators designed to answer the questions a fixed RSI line cannot answer alone. The cluster covers percentile tails, volatility-conditioned thresholds, two-dimensional expectancy, oversold continuation risk, stressed-market rebound probability, and Hidden-Markov regime probabilities.
FAQ
Is this a buy and sell signal indicator?
It can plot arrows, but it is best treated as a research-grade RSI decision layer. Confirm entries with market structure, spread, session, volatility, and risk rules.
Does the free download include source code?
No. The free download is the compiled MT5 .ex5 file only. This keeps the proprietary research logic protected while still letting traders test the indicator.
Can I use it on XAUUSD, forex, crypto, or indices?
Yes, it is symbol based and can be attached to MT5 charts. The included chart image uses XAUUSD H1 because gold exposes RSI regime changes very clearly, but the logic is not limited to gold.