PROTECTED SOURCE SCRIPT

Relational RSI - Trend Identifier

40
This indicator analyzes the relationship between Price and RSI. It doesn't just show you the current RSI value; it compares the current Price-to-RSI relationship against thousands of historical examples to see if the market is behaving "normally."

The core idea is to identify when this historical relationship "decays" or breaks.

  • Positive (Green): Price is higher than it "should be" for the current RSI level, based on history. This is a sign of bullish strength or over-exuberance.
  • Negative (Red): Price is lower than it "should be" for the current RSI level. This is a sign of bearish weakness or being oversold.
  • Zero Line: Price is exactly where history suggests it should be for the current RSI. This is the "normal" or equilibrium state.
  • Think of it as an "expectations" indicator. Is the price over-performing or under-performing relative to its typical momentum signature?


How to Read the Indicator
1. The Main Oscillator (Relational Decay)
  • This is the central line that moves above and below zero.
  • Rising (Bullish Decay): When the line moves up, it means bulls are in control, pushing price higher than the RSI momentum would normally suggest.
  • Falling (Bearish Decay): When the line moves down, it means bears are in control, suppressing price lower than the RSI momentum would normally suggest.
  • Extreme Readings (> 2.0 or < -2.0): These are the dotted/dashed lines. Reaching these zones means the market is in an "extreme" state of deviation—either extremely over-extended (top) or extremely oversold (bottom) relative to its own history.


2. Background Color (Relationship Strength)
The background color tells you how reliable the indicator's main signal is right now.

  • Blue Background: High strength. The historical Price-RSI relationship is stable and consistent. The oscillator's readings are reliable.
  • Orange Background: Low strength. The historical relationship is weak, volatile, or inconsistent. The oscillator's readings are less reliable—the market is choppy or "out of character."


3. Diamonds (Extreme Reversal Signals)
These diamonds appear at potential exhaustion points.

  • Aqua Diamond (at bottom): An "Extreme Bullish Reversal." This appears when the indicator was at an extremely negative (bearish) level and has just started to turn up. It's a potential bottoming signal.
  • Fuchsia Diamond (at top): An "Extreme Bearish Reversal." This appears when the indicator was at an extremely positive (bullish) level and has just started to turn down. It's a potential topping signal.


4. The Info Table (Top Right)
This table provides a snapshot of the current state:

  • RSI/Price: Your current values.
  • Expected Price: The price the indicator "expects" to see based on the current RSI and historical data. This is the most important number.
  • Relational Decay: The main oscillator's value. It's essentially the difference between the Current Price and the Expected Price, normalized.
  • State: A simple text description (e.g., "Stable," "Strong Bullish Decay").
  • Matches Found: How many historical data points the script found to make its calculation.
  • Strength: The "Relationship Strength" (background color) as a percentage.


Key User Inputs

  • RSI Period (14): The lookback for the standard RSI calculation.
  • Historical Lookback (500): How many past bars the indicator should analyze to build its "normal" model. A larger number gives it more historical context.
  • RSI Similarity Threshold (3.0): How close the current RSI must be to a historical RSI to be considered a "match."
  • Normalization Method (Z-Score): The statistical method used to scale the output. Z-Score is standard and robust. "Percentile" and "Raw" are other options for different ways of viewing the deviation.

Aviso legal

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.