All indicators

Normalized RSI Trendline with Divergences

Feb 21, 2025

Static chart image
Dynamic OverlaysSignalsOscillatorsDivergencesMoving Averages

The Normalized RSI Trendline with Divergences indicator provides a sophisticated trend-following framework by transforming traditional RSI values into a normalized, overlay-compatible signal with integrated divergence detection. By smoothing momentum data and mapping it onto price action via linear regression and adaptive moving averages, it offers a clearer perspective on market shifts and potential reversals.

Usage

The indicator can be used to identify both trend direction and exhaustion points. It plots a normalized signal line and a trendline directly on the chart; when the signal line is above the trendline, the cloud turns green, suggesting bullish momentum. Conversely, when it falls below, the cloud turns red, indicating bearish pressure.

The divergence system identifies four distinct signal types:

  • Bullish Divergence: Indicated by a green "Bull" label when price makes a lower low but the oscillator makes a higher low, suggesting a potential upward reversal.
  • Bearish Divergence: Indicated by a red "Bear" label when price makes a higher high but the oscillator makes a lower high, suggesting a potential downward reversal.
  • Hidden Bullish Divergence: Labeled as "hid.", these appear during uptrends when the indicator makes a lower low while price makes a higher low, signaling trend continuation.
  • Hidden Bearish Divergence: Labeled as "hid.", these appear during downtrends when the indicator makes a higher high while price makes a lower high, signaling trend continuation.

Details

The script functions by first calculating a standard RSI and then normalizing it between -1 and 1 based on a user-defined lookback range. This normalized value is then scaled by price volatility (standard deviation) and smoothed using a Weighted Moving Average (WMA) to create the "Norm Signal." This allows the momentum indicator to be plotted as an overlay on the price chart.

The "Trend Line" is derived from a linear regression of this signal, while the "Center Line" utilizes an Arnaud Legoux Moving Average (ALMA) to provide a smoother, lag-reduced baseline for the trend. Divergences can be calculated based on either the raw RSI or the processed Normalized RSI, depending on user preference.

Settings

  • Signal Period: Sets the length for the initial RSI calculation and volatility scaling.
  • Lookback Range: Determines the window used for normalizing the RSI values between -1 and 1.
  • Source: The price data used for calculations (default is HLC3).
  • Trend Length: Controls the length of the WMA and Linear Regression used for the signal and trendlines.
  • Band Width: The window size for the ALMA-based Center Line.
  • Offset: Adjusts the displacement of the ALMA and Linear Regression.
  • Sigma Value: Adjusts the smoothness/responsiveness of the ALMA.
  • Divergence Selection: Choose between "RSI" or "Normalized RSI" as the source for divergence detection.
  • Divergence Range: The pivot lookback used to identify peaks and troughs for divergence.
  • Show Normal/Hidden Divergences: Toggles the visibility of respective divergence labels on the chart.

FAQ

How do I interpret the color changes in the signal cloud? The cloud highlights the relationship between the normalized signal and its trendline. Green indicates the signal is leading the trendline (bullish), while red indicates it is lagging (bearish).

Can I use this on any timeframe? Yes, the indicator is adaptive, though users may need to adjust the "Signal Period" and "Lookback Range" to account for the different volatility profiles of lower or higher timeframes.

How can I access this tool? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.