Indicator · Pine Script v5 · Own pane

Hidden Relative Strength

by eddiebelaval· code credited to BigGuavaTrading

The Hidden Relative Strength indicator normalizes price changes of a symbol by dividing them by ATR volatility, then subtracts the normalized move of a benchmark symbol such as QQQ to derive raw relative strength.

View on GitHub

GitHub stars7on the repository
Pine versionv5runs as is
Lines of code83
Settings5inputs
LicenceNone statedfile: MPL-2.0
Last update3 months ago24 Jul 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

83 lines of Pine Script v5 from pinescript/volatility/hidden-relative-strength-st.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

hidden-relative-strength-st.pine
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © BigGuavaTrading
//@version=5

// 1. STANDARDIZATION: Name [ST]
indicator("Hidden Relative Strength [ST]", shorttitle="HRS [ST]", overlay=false, precision=2)

// 2. VERSION CONTROL
string ver_num  = "v6.4"
string ver_date = "2026-02-09"

// ==========================================
// 1. INPUTS
// ==========================================
grp_calc = "Calculation Settings"
grp_vis  = "Visual Settings"

// Benchmark Symbol (Default QQQ for SMB Style)
sym_bench = input.symbol("NASDAQ:QQQ", "Benchmark Symbol", group=grp_calc, display=display.data_window)

// ATR Length (Default 5 for SMB Style)
len_atr   = input.int(5, "ATR Period", minval=1, group=grp_calc, tooltip="SMB uses 5 for faster reaction.", display=display.data_window)

// Calculation Mode
calc_type = input.string("Simple (SMA)", "ATR Type", options=["Simple (SMA)", "Smoothed (RMA)"], group=grp_calc, tooltip="SMB uses Simple (SMA).", display=display.data_window)

// Signal Line
show_sig  = input.bool(false, "Show Signal Line?", group=grp_vis, display=display.data_window)
len_sig   = input.int(20, "Signal MA Period", minval=1, group=grp_vis, display=display.data_window)

// ==========================================
// 2. CALCULATIONS
// ==========================================

// --- A. CURRENT ASSET (The Stock) ---
// Calculate local volatility components
float vol_sma_sym = ta.sma(ta.tr, len_atr)
float vol_rma_sym = ta.rma(ta.tr, len_atr) // standard ATR

// Select local volatility
float vol_sym = calc_type == "Simple (SMA)" ? vol_sma_sym : vol_rma_sym

float chg_sym = close - close[1]
// Normalize: (Change / Volatility)
float norm_move_sym = nz(chg_sym / vol_sym)


// --- B. BENCHMARK (QQQ/SPY) ---
// Request all potential data at once to avoid conditional errors
[b_close, b_vol_sma, b_vol_rma] = request.security(sym_bench, timeframe.period, [close, ta.sma(ta.tr, len_atr), ta.rma(ta.tr, len_atr)])

// Select benchmark volatility AFTER the request
float b_vol = calc_type == "Simple (SMA)" ? b_vol_sma : b_vol_rma

float chg_bench = b_close - b_close[1]
// Normalize
float norm_move_bench = nz(chg_bench / b_vol)


// --- C. HIDDEN RELATIVE STRENGTH MATH ---
// Formula: Stock Normalized Move MINUS Market Normalized Move
float raw_rs = norm_move_sym - norm_move_bench

// Accumulate (The Line)
// FIXED MULTIPLIER (10x) applied internally for better Y-Axis scaling
float rs_line = ta.cum(raw_rs) * 10.0

// Signal
float rs_sig  = ta.sma(rs_line, len_sig)

// ==========================================
// 3. PLOTTING
// ==========================================
// Color Logic: Dark Blue (Royal Blue)
color col_rs = #2962ff 

plot(rs_line, "Hidden RS Line", color=col_rs, linewidth=2, display=display.pane + display.data_window)
plot(show_sig ? rs_sig : na, "Signal MA", color=color.gray, style=plot.style_line, display=display.pane + display.data_window)

// ==========================================
// 4. ALERTS
// ==========================================
alertcondition(ta.crossover(rs_line, rs_sig), "RS Breakout", "Hidden RS Line broke above Signal MA")

Overview

This value is accumulated over time, scaled by 10 for visualization, and optionally smoothed with a signal line SMA. It plots the RS line and signal line in a separate pane. Users can select the benchmark symbol, ATR period and type, signal visibility, and signal period. The script issues crossover alerts when the RS line breaks above the signal. It is suitable for stocks and indices across any timeframes but requires manual interpretation since there are no predefined exit rules.

Details

Published by

eddiebelaval on GitHub

Code credit

BigGuavaTrading, as written in the script's header

Draws

Separate pane below the chart

Markets

Stocks, Indices

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Benchmark SymbolsymbolNASDAQ:QQQsym_bench
ATR Periodint5len_atr
ATR TypestringSimple (SMA)calc_type
Show Signal Line?boolfalseshow_sig
Signal MA Periodint20len_sig
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

TTM Squeeze

by Alorse
330 stars

This indicator plots a TTM Squeeze momentum oscillator in a separate pane. It compares a Bollinger Band offset to a Keltner Channel offset and marks the zero line white when the difference is non-negative and black when the bands are inside the channel. A line

Indicator v5 Oscillators & momentumVolatility & bands
Updated 2 months ago · None stated GitHub repository of TTM Squeeze

Function - Logistic Equation

by ricardosantos79
261 stars

Calculates dynamic modeling values by applying a mathematical logistic differential equation to price change over a specified lookback length. It measures price momentum relative to the recent high-low price range. The script plots positive and negative logist

Indicator v5 Oscillators & momentumVolatility & bands
Updated 4 years ago · None stated GitHub repository of Function - Logistic Equation
228 stars

This indicator detects a Bollinger Band squeeze when the bands sit inside Keltner Channels, marking low volatility. It plots red dots during a squeeze and green dots when the bands are outside, in a separate pane. An optional histogram shows momentum as the cl

Indicator v6 Volatility & bandsOscillators & momentum
Updated 3 months ago · None stated GitHub repository of Bollinger Band Squeeze Detector

MACD-V

by harryguiacorn
220 stars

MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us

Indicator v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of MACD-V
147 stars

This indicator generates trade entry signals and target levels optimized for 1-hour timeframes, designed for external signal extraction. It calculates 7-period and 16-period EMAs alongside 10-period RSI and ATR filters. Long signals occur when the fast EMA cro

Indicator v5 TrendOscillators & momentum
Updated 6 weeks ago · MIT GitHub repository of Signal Strategy 100 Candles of 1H Timeframe

Bubbles Indicator

by capissimo
114 stars

The Bubbles Indicator measures volatility squeezes and expansion bursts using Bollinger Bands combined with a sinusoid oscillator and RSI divergence. It processes price data through scaled Bollinger Bands to highlight volatility changes while confirming trend

Indicator v4 Volatility & bandsOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of Bubbles Indicator

More Volatility & bands scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers