Overview

RSI RMI with Range MA is an overlay momentum + trend indicator that blends RSI and MFI into a single composite momentum score, then uses that score to color candles and plot a range-weighted moving average (RWMA) as a dynamic trend guide. It’s built to help you stay aligned with bullish/bearish momentum regimes and clearly spot the exact bar where momentum flips.

How it works

  • RSI-MFI composite: RSI is calculated using RMA-smoothed gains/losses and MFI is calculated over the same RMI Length. The script then averages them into rsi_mfi.
  • Momentum regimes:
    • Positive momentum: triggers when rsi_mfi crosses up through Positive Above (default 66) while the 5-EMA is rising.
    • Negative momentum: triggers when rsi_mfi is below Negative Below (default 33) while the 5-EMA is falling.
  • Sticky state logic: Once a bullish/bearish regime triggers, it remains active until the opposite condition triggers. This helps reduce rapid flip-flopping.
  • RWMA baseline: A 20-period range-weighted moving average is computed using each candle’s range (high-low) as its weight (larger range = heavier influence).
  • Dynamic offset band: A Band is derived from ATR(30) vs a small % of price, and the code references a delayed value for the final distance. The plotted RWMA is shifted by this Band:
    • Bullish: rwma - Band
    • Bearish: rwma + Band

What you’ll see on the chart

  • RRTH line (thick): A shifted RWMA line that appears only when a bullish or bearish regime is active.
  • Candle + bar coloring:
    • Green = Positive momentum active
    • Red = Negative momentum active
    • Gray = No active regime
  • Flip labels:
    • LONG label on the first bar a Positive regime starts
    • SHORT label on the first bar a Negative regime starts

Indicator Information

Version 1.1
Last Update 21 Feb 2026
Category Momentum & Trend
Compatibility TradingView
Script Pine Script v5