OPEN-SOURCE SCRIPT

Quantum Momentum Analyzer [JOAT]

1 026
Quantum Momentum Analyzer

Introduction

The Quantum Momentum Analyzer is an open-source oscillator that reimagines traditional RSI through a multi-layered, regime-aware framework. Instead of relying on a single RSI line, this indicator calculates multiple RSI variants simultaneously — raw, smoothed, volume-weighted, and multi-layer — then blends them into a composite "Quantum RSI" that adapts to changing market conditions. It also includes regime detection, neural divergence identification, and momentum burst alerts, all presented through a visually rich interface with gradient coloring and an information dashboard.

Built with Pine Script v6, the indicator uses custom types to manage divergence points, regime states, momentum bursts, and quantum zones as structured objects.

สแนปชอต

Why This Indicator Exists

Standard RSI is a powerful concept, but a single 14-period RSI line has well-known limitations: it gives false overbought/oversold signals in trending markets, it lacks volume context, and it treats all market regimes the same way. This indicator addresses those gaps by:

  • Multi-dimensional RSI: Combines four RSI calculations (raw, smoothed, volume-weighted, multi-layer) into a single adaptive reading that is more robust than any individual RSI
  • Regime detection: Automatically classifies the market as Trending, Ranging, Volatile, or Calm, and adjusts the visual presentation accordingly
  • Volume weighting: Incorporates volume into the RSI calculation so that high-volume moves carry more weight than low-volume noise
  • Neural divergence: Detects divergences between price and the quantum RSI using pivot-based analysis with configurable lookback and maximum divergence distance
  • Momentum bursts: Identifies sudden, explosive momentum shifts that often precede significant price moves


Core Components Explained

1. Multi-Layer RSI System

The indicator calculates four distinct RSI values and combines them into a weighted composite:

Pine Script®


The multi-layer RSI uses three configurable periods (default 7, 14, 21) to capture momentum across short, medium, and long cycles. The final Quantum RSI is a weighted average of all four, giving a reading that is smoother than raw RSI but more responsive than heavily smoothed alternatives.

2. Regime Detection

The regime detector classifies market conditions using ADX for trend strength and ATR percentile for volatility:

  • Trending: ADX above threshold (default 25) — momentum signals are more reliable
  • Ranging: ADX below threshold with low volatility — overbought/oversold levels become more meaningful
  • Volatile: High ATR percentile regardless of ADX — wider bands and more cautious interpretation needed
  • Calm: Low ADX and low volatility — reduced signal reliability, smaller moves expected


The background color subtly shifts based on the detected regime, giving traders an immediate visual cue about the current market environment without needing to check additional indicators.

3. Neural Divergence Detection

Divergences are detected by comparing pivot highs and lows in price against corresponding pivots in the Quantum RSI. A bullish divergence occurs when price makes a lower low but the Quantum RSI makes a higher low, suggesting weakening selling pressure. A bearish divergence is the inverse.

The detection uses configurable parameters:
  • Pivot lookback (default 5): How many bars to look back for pivot confirmation
  • Max divergence bars (default 50): Maximum distance between the two pivots forming the divergence


Divergences are plotted as labeled markers on the oscillator panel, making them easy to spot without cluttering the price chart.

The Quantum Momentum Analyzer oscillator panel showing the multi-layer RSI line with regime-colored background zones and divergence markers

4. Momentum Burst Detection

A momentum burst fires when the rate of change in the Quantum RSI exceeds a configurable threshold within a short window. These bursts often coincide with the start of impulsive moves. Each burst is tracked as an object with a direction, strength value, and bar index, and is visualized as a highlighted marker on the oscillator.

5. Quantum Zones

The indicator defines dynamic zones on the oscillator based on the current regime and RSI behavior. These zones represent areas of high probability for reversals or continuations. In trending regimes, the zones shift to accommodate the tendency for RSI to stay elevated (in uptrends) or depressed (in downtrends), rather than using fixed 70/30 levels.

Visual Elements

  • Quantum RSI Line: The main composite RSI plotted with gradient coloring that shifts from bearish to bullish tones
  • Overbought/Oversold Levels: Horizontal reference lines at configurable levels (default 70/30) with a midline at 50
  • Regime Background: Subtle background coloring indicating the current market regime
  • Momentum Histogram: A histogram showing the rate of change of the Quantum RSI, color-coded by direction and intensity
  • Divergence Markers: Labels marking bullish and bearish divergences directly on the oscillator
  • Momentum Burst Markers: Highlighted signals when explosive momentum is detected
  • Dashboard: Real-time display of Quantum RSI value, regime state, divergence status, momentum direction, and burst alerts


Input Parameters

RSI Settings:
  • RSI Length (default 14): Base period for RSI calculations
  • Smoothing Length (default 5): EMA smoothing applied to the raw RSI
  • Overbought / Oversold levels (default 70 / 30)
  • Volume Weighting: Toggle volume-adjusted RSI component


Regime Detection:
  • ADX Length (default 14)
  • ADX Threshold (default 25): Above this = trending
  • ATR Percentile Length (default 100): Lookback for volatility ranking


Divergence Detection:
  • Pivot Lookback (default 5)
  • Max Divergence Bars (default 50)


Multi-Layer RSI:
  • Layer 1 / 2 / 3 Length (default 7, 14, 21)


Visual Settings:
  • Show Momentum Histogram, Dashboard, Glow Effects, Pulse Effects


สแนปชอต

How to Use This Indicator

Step 1: Check the regime background. In a trending regime, focus on momentum continuation signals rather than overbought/oversold reversals. In a ranging regime, the 70/30 levels become more actionable.

Step 2: Monitor the Quantum RSI line for crossovers of the 50 midline. A cross above 50 with rising momentum histogram suggests bullish momentum is building.

Step 3: Watch for divergences. A bullish divergence near the oversold zone in a ranging regime is a higher-probability reversal signal than one in a strong trending regime.

Step 4: Use momentum bursts as early warnings. A burst in the direction of the prevailing trend often signals the start of an impulsive move.

Step 5: Confirm with the dashboard. The dashboard provides a quick summary of all components so you can assess the overall momentum picture at a glance.

Dashboard view showing regime state, Quantum RSI value, divergence status, and momentum burst alert in a trending market

Indicator Limitations

  • Like all RSI-based tools, this indicator is a lagging momentum measure. It confirms momentum shifts after they begin, not before.
  • Volume-weighted RSI requires reliable volume data. On instruments with sparse or unreliable volume (some forex pairs, illiquid assets), consider disabling volume weighting.
  • Regime detection uses ADX, which itself has a lag. Regime transitions may be identified a few bars after they actually begin.
  • Divergences do not guarantee reversals. They indicate weakening momentum, but price can continue in the original direction for an extended period.
  • The multi-layer RSI adds smoothing, which reduces noise but also reduces responsiveness to sudden moves.
  • Momentum bursts can produce false signals during choppy, low-conviction markets.


Originality Statement

This indicator is original in its multi-dimensional approach to RSI analysis. While RSI, divergence detection, and regime filtering are established concepts individually, this indicator is justified because:

  • It fuses four distinct RSI methodologies (raw, smoothed, volume-weighted, multi-layer) into a single composite reading
  • Regime-aware interpretation automatically adjusts context based on ADX and volatility, something standard RSI indicators do not provide
  • The neural divergence system uses pivot-based detection with configurable distance limits, providing more precise divergence identification than simple lookback methods
  • Momentum burst detection adds an event-driven layer that identifies explosive shifts in RSI momentum
  • The quantum zone system dynamically adjusts overbought/oversold interpretation based on the current regime rather than using static levels


Disclaimer

This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. RSI and momentum analysis are tools for understanding market dynamics, not guarantees of future price movement. Always use proper risk management. The author is not responsible for any losses incurred from using this indicator.

-Made with passion by officialjackofalltrades

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน