Quantum Momentum Analyzer [JOAT] – Multi-Layer RSI with Regime Detection

Quantum Momentum Analyzer [JOAT] – Multi-Layer RSI with Regime Detection

Key takeaways

  1. Blends four RSI calculations into one composite reading that adapts to trending, ranging, and volatile regimes automatically
  2. Detects divergences with strength scoring so only high-confidence signals get through, filtering out the noise that plagues basic RSI setups
  3. Includes momentum burst detection with volume confirmation, useful for catching breakout entries in algo trading systems
  4. Run it locally with PineTS on Node.js for backtesting or real-time signal generation through the Binance data provider

Loading chart…

Indicator Credits : Author : JOAT

What Is the Quantum Momentum Analyzer?

Alright so here’s the thing about RSI. Everyone uses it, everyone knows it, and everyone has been burned by it at least once. You get an overbought signal at 70, you short, and the market just keeps grinding higher for another three weeks. Classic.

The Quantum Momentum Analyzer by JOAT takes a completely different approach. Instead of trusting a single RSI line to tell you something useful, it runs four RSI calculations simultaneously (raw, smoothed, volume-weighted, and multi-layer across three timeframes) and blends them into a composite reading. On top of that, it has regime detection, divergence scanning, momentum burst alerts, and a full dashboard. It’s basically RSI on steroids, with a regime-awareness system bolted on.

I ran this through PineTS on weekly BTCUSDC data and honestly, the regime detection is what caught my attention. It automatically classifies whether you’re in a strong bull, mild bull, neutral, mild bear, strong bear, or extreme bear environment, and adjusts the overbought/oversold levels dynamically. That alone makes it more useful than a plain RSI setup for algo trading.


Running It Locally with PineTS

Running this off TradingView means you can wire it into your own backtesting and signal generation systems. Here’s the setup.

Install PineTS

Grab the package from npm:

npm install pinets

Loading the Pine Script Indicator

PineTS compiles and executes Pine Script v6 natively in Node.js. You feed it the raw .pine source file, point it at a data provider (Binance in this case), and it processes every bar just like TradingView would. All 34 plots from the Quantum Momentum Analyzer come through, including the Quantum RSI line, the multi-layer RSI variants, divergence signals, and momentum histograms.

Batch Execution with pineTS.run()

For a one-shot historical analysis, just load and run:

// PineTS batch execution example template
import { PineTS, Provider } from 'pinets'
import { readFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'

const __dirname = dirname(fileURLToPath(import.meta.url))
const pineScript = readFileSync(join(__dirname, 'source.pine'), 'utf-8')

const pineTS = new PineTS(Provider.Binance, 'BTCUSDC', '1w', 500)
const ctx = await pineTS.run(pineScript)

console.log('Bars processed:', ctx.marketData.length)
console.log('Plots:', Object.keys(ctx.plots).join(', '))

for (const [name, plot] of Object.entries(ctx.plots)) {
  const lastPoint = plot.data?.[plot.data.length - 1]
  if (lastPoint) {
    console.log(`  ${name}: last value = ${lastPoint.value}`)
  }
}

That pulls 500 weekly BTCUSDC candles and exposes all 34 plots: Quantum RSI composite, fast/slow/ultra-fast layers, divergence markers, histogram values, and the regime state. Enough to build real signal logic from.

Live Streaming with pineTS.stream()

Want live updates? The stream API fires on every new candle from Binance:

// PineTS live streaming example template
import { PineTS, Provider } from 'pinets'
import { readFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'

const __dirname = dirname(fileURLToPath(import.meta.url))
const pineScript = readFileSync(join(__dirname, 'source.pine'), 'utf-8')

const pineTS = new PineTS(Provider.Binance, 'BTCUSDC', '1w', 500)

let count = 0
const stream = pineTS.stream(pineScript)

stream.on('data', (ctx) => {
  count++
  console.log(`[Update ${count}] Bars: ${ctx.marketData.length}, Plots: ${Object.keys(ctx.plots).length}`)

  for (const [name, plot] of Object.entries(ctx.plots)) {
    const lastPoint = plot.data?.[plot.data.length - 1]
    if (lastPoint) {
      console.log(`  ${name}: ${lastPoint.value}`)
    }
  }

  if (count >= 5) {
    console.log('Received 5 updates, stopping stream.')
    process.exit(0)
  }
})

stream.on('error', (err) => {
  console.error('Stream error:', err.message)
  process.exit(1)
})

Each callback gives you a fresh context with all plots recalculated. Hook this into your bot and you’re reacting to regime flips and divergence signals in real time, not polling historical data after the fact.


Indicator Properties

Inputs

The indicator has 27 inputs across six groups:

Configuration

InputTypeDefaultDescription
RSI Lengthint14Base period for all RSI calculations
RSI Smoothingint3EMA smoothing applied to raw RSI values
Overbought Levelfloat70Static overbought threshold (adjusted dynamically by quantum value)
Oversold Levelfloat30Static oversold threshold (adjusted dynamically by quantum value)
Volume-Weighted RSIbooltrueEnable volume-adjusted RSI component in the composite
Volume Weight Lengthint20SMA period for volume weighting calculation

Quantum Regime Detection

InputTypeDefaultDescription
Regime Lookbackint50Period for calculating RSI mean and standard deviation
Regime Thresholdfloat5.0RSI distance from 50 to trigger regime classification
Show Regime BackgroundbooltrueColor the chart background by regime state
Show Quantum ZonesbooltrueDisplay dynamic support/resistance zones
Quantum Sensitivityint3Controls the amplitude influence on the Quantum RSI blend (1-5)

Neural Divergence Detection

InputTypeDefaultDescription
Show DivergencesbooltrueEnable divergence marker plotting
Pivot Lookbackint5Bars to look back for pivot confirmation
Max Divergence Barsint50Maximum distance between two pivots forming a divergence
Show Hidden DivergencesbooltrueAlso plot hidden (continuation) divergences
Divergence Strength Thresholdfloat0.5Minimum strength score required to plot a divergence signal

Multi-Dimensional Analysis

InputTypeDefaultDescription
Show Multi-Layer RSIbooltrueDisplay fast, slow, and ultra-fast RSI layers
Fast RSI Lengthint7Short-term RSI period
Slow RSI Lengthint21Long-term RSI period
Ultra-Fast RSI Lengthint3Very short-term RSI for momentum spikes
Show Momentum VortexbooltrueDisplay animated vortex particles around the RSI line

Visual Effects

InputTypeDefaultDescription
Show Momentum HistogrambooltrueDisplay the RSI delta histogram at the centerline
Show DashboardbooltrueShow the top-right information table
Histogram Widthint2Column width for the momentum histogram
Show Glow EffectsbooltrueAdd glow to the main Quantum RSI line
Show Pulse AnimationbooltrueSubtle pulsing background effect during active regimes
Color SchemestringQuantumVisual theme: Quantum, Neon, Plasma, or Monochrome

Advanced Settings

InputTypeDefaultDescription
Show Momentum BurstsbooltrueHighlight sudden momentum acceleration events
Burst Thresholdfloat3.0Minimum acceleration required to trigger a burst signal
Show Momentum FlowbooltrueDraw trailing flow lines behind the RSI
Flow Lengthint10Number of bars for the momentum flow trail

Plots

Plot NameTypeDescription
Quantum RSILine (width 3)Main composite RSI blending raw, smoothed, volume-weighted, and quantum-modulated values. Gradient colored by momentum.
Fast RSILine (width 2)Short-term RSI (default 7-period), EMA smoothed. Green tint.
Slow RSILine (width 2)Long-term RSI (default 21-period), EMA smoothed. Orange tint.
Ultra-Fast RSILine (width 1)Very short-term RSI (default 3-period) for catching momentum spikes. Purple tint.
Volume-Weighted RSILine (width 2)RSI calculated from volume-weighted price, showing where the money is actually flowing. Yellow.
Quantum OverboughtLineDynamic overbought level, shifts based on the quantum amplitude value.
Quantum OversoldLineDynamic oversold level, same quantum adjustment as overbought.
Quantum MomentumHistogramRSI delta (fast minus slow) plus quantum offset, plotted as columns around the 50 centerline.
Ultra MomentumHistogramUltra-fast RSI rate of change, scaled and plotted as thin columns around 50.
Divergence MarkersShapesBull/bear divergences (strong and weak) plus hidden divergences, plotted at pivot locations.

Alerts

AlertCondition
Quantum Overbought EntryQuantum RSI crosses above the dynamic overbought level
Quantum Oversold EntryQuantum RSI crosses below the dynamic oversold level
Bullish DivergencePrice makes lower low while Quantum RSI makes higher low
Bearish DivergencePrice makes higher high while Quantum RSI makes lower high
Bullish Regime ChangeRegime state shifts from neutral/bearish to bullish
Bearish Regime ChangeRegime state shifts from neutral/bullish to bearish
Momentum BurstRSI acceleration exceeds threshold with volume spike (1.5x average)
Vortex ActivationMomentum vortex intensity crosses above 1.0
Quantum High StateQuantum amplitude exceeds 0.5 (strong phase alignment)
Quantum Low StateQuantum amplitude drops below -0.5 (weak phase alignment)

Understanding the Indicator

The Multi-Layer RSI Composite

Here’s where JOAT’s approach gets interesting. Instead of picking one RSI period and hoping it works, the indicator runs four independent RSI calculations and merges them. The raw RSI (ta.rsi(close, rsiLength)) gives you the standard 14-period reading. That gets EMA-smoothed with a 3-bar window to knock out noise. A volume-weighted variant uses ta.sma(close * volume, volWeightLength) / ta.sma(volume, volWeightLength) as its source, so bars with heavy volume pull the reading more than thin bars. Then a multi-layer RSI averages three different periods (7, 14, 21) to capture momentum across short, medium, and long cycles.

The final Quantum RSI blends the smoothed RSI with the volume-weighted variant using a “quantum amplitude” factor. I’ll be honest, the “quantum” label is just branding for a sine-wave modulator derived from the timestamp: quantumPhase = (time / 100000) % (2 * math.pi). It creates a cyclical oscillation that shifts how much weight the volume-weighted component gets. The practical effect? The composite RSI reading drifts slightly between favoring smoothed momentum and favoring volume-confirmed momentum, which actually prevents it from getting stuck in one mode.

Regime Detection That Actually Adapts

This is the feature that makes the indicator worth a closer look. The detectQuantumRegime() function classifies the market into seven states: extreme bull (3), strong bull (2), mild bull (1), neutral (0), mild bear (-1), strong bear (-2), and extreme bear (-3). It does this by measuring how far the Quantum RSI has deviated from its 50-bar mean, scaled by its own standard deviation, then modified by volume relative to its average.

When the Quantum RSI sits above 55 (50 plus the default 5.0 threshold) and the z-score deviation is above 1.5, you’re in extreme bull territory. The background shifts to a bright cyan-green tint. Drop below -1.5 deviation on the bearish side and it flips to bright red. The overbought and oversold levels themselves adjust too, via quantumOb = obLevel + quantumValue * 5, so in a strong bullish regime the overbought line pushes higher, making it harder to trigger a premature reversal signal.

That directly solves the classic RSI problem of flagging “overbought” while a strong trend just keeps running.

Divergence Detection with Strength Scoring

JOAT didn’t just slap a basic divergence detector on this. The system uses pivot-based detection on both price and the Quantum RSI, with a configurable lookback (default 5 bars for pivot confirmation) and a maximum distance of 50 bars between the two pivots forming the divergence. But the interesting part is the strength calculation.

Each divergence gets scored using calculateDivergenceStrength(), which blends three factors: price difference (40% weight), RSI difference (40% weight), and volume difference (20% weight). Only divergences exceeding the strength threshold (default 0.5) get plotted. Strong divergences (strength above 1.0) get a bigger label (“BULL DIV” or “BEAR DIV”), while weaker ones get a smaller marker. This filtering is crucial for algo trading because it cuts out the noise divergences that look good on a chart but lead nowhere in practice.

Hidden divergences (continuation signals) are supported too. A hidden bullish divergence fires when price makes a higher low but the Quantum RSI makes a lower low, suggesting the uptrend has more room to run despite the momentum dip.

Using It for Algorithmic Signal Generation

So now that you understand what the indicator is computing, let’s talk about actually using it. I’ve been testing this on weekly BTCUSDC and here’s what works well.

Start with the regime as your filter. Don’t try to catch reversals in an extreme bull or extreme bear regime. Those readings mean momentum is strong and confirmed by volume. Instead, use the regime to decide which signals to act on. In a strong bull regime (regime.current >= 2), only take bullish divergences and momentum bursts in the upward direction. In a ranging/neutral regime (0), the overbought/oversold crossovers become your primary signals.

Momentum burst detection is gold for breakout strategies. A burst fires when the ultra-fast RSI acceleration exceeds the threshold AND volume spikes above 1.5x the 20-bar average. That dual confirmation (momentum + volume) filters out a lot of the fake breakouts you’d get from momentum alone. Wire the “Momentum Burst” alert into your bot and use the regime direction to decide whether to go long or short.

For mean-reversion strategies, watch the delta between the fast RSI (7-period) and slow RSI (21-period). When rsiDelta expands beyond +/-5 in a neutral regime, it tends to snap back. Visually the histogram makes this obvious, but programmatically you want to track rsiFastSmooth - rsiSlowSmooth from the PineTS output.

One approach I’d recommend: use the Quantum RSI crossing 50 as your trend direction filter, the regime state as your confidence level, and the divergence signals as your actual entry triggers. Layer those three together and you have a system that’s significantly more robust than a raw RSI crossover strategy.

Performance Notes

A few things to keep in mind for production use. With 500 max lines, 200 max boxes, and 200 max labels, this is a heavier indicator. Weekly and daily timeframes handle it fine in PineTS, but drop to 1-minute bars with 500 candles and expect slower execution from the divergence detection and vortex particle calculations running on every bar.

One quirk: the “quantum phase” uses time / 100000 as its seed, so the modulation produces different readings depending on your data provider’s timestamp precision. Binance weekly candles handle this fine. Providers with millisecond-precision timestamps will cycle through the phase faster, so your readings won’t exactly match TradingView’s chart.

Five-bar pivot confirmation means a weekly divergence takes over a month to show up. On 4H charts, you’d see signals within about a day. Your stops and position sizes need to account for that delay.

Regime detection needs 50 bars of history to stabilize. On weekly BTCUSDC, that’s roughly a year of data. The default 500-candle fetch gives you plenty of runway, but if you drop the candle count, know that the regime readings will be unreliable for the first stretch.


Important Notes

All 34 plots render correctly in PineTS, as you’d expect from the test run above. The dashboard table comes through as a data structure in the PineTS context rather than a visual table, so parse it from there rather than looking for DOM output.

You’ll need the Binance data provider for the default BTCUSDC pair. Other providers work too, but volume data quality varies, and since this indicator leans heavily on volume weighting, unreliable volume data will degrade the Quantum RSI composite and regime detection accuracy. Stick with exchanges that report real volume.

The glow, pulse, and vortex particle effects don’t translate to anything useful in PineTS. They just show up as extra plot values. Ignore them and pull from the Quantum RSI, regime state, divergence markers, and burst flags.

Disclaimer

QuantForge publishes technical material about indicators: what they do, how they are built, and how you can experiment with them in code and on charts. All of this is offered for education and illustration only. It is not financial, investment, or trading advice, and it should not be read as a recommendation to buy, sell, or hold any asset. Past or simulated performance does not guarantee future results. You are responsible for your own decisions; seek independent professional advice where appropriate.