Adaptive Modern RSI [GBB]Adaptive Modern RSI
A self-tuning RSI. Instead of you picking a period and overbought/oversold levels and hoping you got it right, the indicator figures out the best settings from recent price action and adjusts as the market changes.
It tests 60 different parameter combinations on every bar (5 RSI periods, 3 smoother strengths, 4 threshold pairs), measures how each one would have performed over the last 300 bars, and uses whichever combination scored best. When the market shifts, the parameters shift with it.
The thinking behind it: Wilder published the RSI in 1978. The "14 period, 70/30 levels" defaults were chosen for stock markets that traded a few hours a day. Crypto, 24/7 markets, and modern volatility didn't exist yet.
What you see on the chart
The aqua line is the active RSI — whichever period and smoother the optimizer currently picked.
The red and green horizontal lines are the adaptive overbought and oversold levels. They step when the optimizer changes its mind about what counts as "extreme" for this asset right now.
Red triangles fire when the RSI rolls over from overbought. Green triangles fire when it enters oversold. Both fire on bar close and never repaint.
The label at the top tells you what kind of market the recent past has been. Five possible regimes:
Mean-reverting chop — Fast reversals at extremes. RSI triggers are most reliable here.
Quiet range — Mild swings, modest signal. Use as light confluence only.
Trending — Mean reversion is dangerous here. Use the RSI for pullback entries in the trend direction, not for fading.
Noisy transition — The indicator can't find a stable read. Step back, wait for clarity.
Adapting — Warming up on a fresh chart. Give it the lookback period worth of bars.
Next to the regime name you'll see "held N bars." That tells you how long the current regime read has been stable. A regime held for 200+ bars is a confident read. A regime that just flipped (held 5 bars) is fresh and should be weighted lightly.
How to use it per regime
Mean-reverting chop :This is the regime RSI was designed for. Use the triggers actively, with normal confluence requirements (price at a level, HTF context, etc.). Tight stops, normal targets.
Quiet range: Triggers work but the moves are small. Better for intraday scalp confluence than positional setups. Don't size up on triggers alone.
Trending : Invert the classic logic. Green triangles in an uptrend are pullback buys, not counter-trend opportunities. Red triangles in a downtrend are bounce shorts. Never fade triggers against the trend in this regime — that's how RSI users blow up accounts.
Noisy transition : Sit on your hands. The indicator is telling you it can't find a signal. This is rare but valuable information — most indicators don't admit when they don't know.
Adapting : Wait. On 1H with default 300-bar lookback, this takes about 12-13 days of data.
What it works on
Designed for crypto, but the logic is asset-agnostic. The optimizer figures out the right parameters from whatever data you give it. Tested on:
- Crypto (BTC, ETH, majors) on 5M through 1D
- Forex majors on 15M through 4H
- Indices (NDX, SPX, DAX) on 1H through 1D
- Gold on 1H through 1D
On lower timeframes (5M, 15M), consider raising the optimization lookback from 300 to 500-700 bars. On higher timeframes (4H, 1D), you can lower it to 100-200. The default 300 is tuned for 1H. The tooltip on the input has more detail.
Everything else (forward-return horizon, switch margin, regime hysteresis) can stay at defaults across all assets and timeframes for a first pass.
What it is not
A complete trading system. This is one RSI layer. It tells you something about momentum and mean-reversion potential. It does not tell you about trend, volume, market structure, key levels, or risk management. If you trade off this alone, you will lose money.
A leading indicator. Triggers fire on bar close, after the crossover happens. There is no lag in the sense of waiting for confirmation bars, but there is also no prediction. The indicator is reactive to closed-bar price action, not forecasting future bars.
A backtest-proof strategy. The parameter optimization is backward-looking. It tunes to what worked recently. At regime transitions (chop becoming trend, trend becoming crash), the indicator will lag because its lookback window is still anchored to the old regime. The regime label and the "held N bars" counter give you the information to know when to trust it more or less.
Settings
Optimization lookback (default 300) : How many bars the optimizer searches over. Shorter adapts faster but jitters more. Longer is stabler but slower to catch genuine regime shifts.
Forward-return evaluation horizon (default 5) : How many bars forward the optimizer measures trigger payoffs. 5 is a reasonable mean-reversion timescale. Bump to 8-10 for forex if you want to.
Switch margin (default 10%) : New parameter winners need to beat the current ones by this much to take over. Higher means stickier parameters.
Minimum triggers required (default 5) : Candidates firing fewer than this many times in the lookback are disqualified. Prevents noisy low-sample-size winners.
Regime label hysteresis (default 10): Bars the new regime classification must hold before the displayed label updates. Higher means more stable label, slower to react to genuine shifts.
Regime label size : Tiny to huge. Pick whatever fits your screen.
Final note
This indicator does not replace thinking. It does not replace risk management. It does not replace knowing the asset you're trading. It gives you a better RSI than 1978's defaults. The rest is on you.
Made by The Good, the Bad and the Bitcoin (GBB)
Quantitative trading research with no shilling, no paywall, and no hype.
אינדיקטור Pine Script®






















