OPEN-SOURCE SCRIPT

[Viprasol] Real Relative Strength

686
Overview

This indicator is based on the open-source "Real Relative Strength" (RRS) concept, which measures how an asset is performing against a benchmark after normalising for volatility. The original plots ATR-normalised relative momentum versus a benchmark (e.g. SPY) with zero-cross arrows and strong/weak zones. This version keeps that calculation and adds RRS/price divergence detection, a second-benchmark agreement filter, a signal cooldown, an RRS acceleration read, and a compact dashboard.

How It Works

Real Relative Strength (from original concept):
Relative momentum = (asset momentum − benchmark momentum) / average ATR × multiplier, where momentum is close − close[length] for both the asset and the benchmark, and the divisor is the average of the asset and benchmark ATR. The result is smoothed with an EMA. Positive = the asset is outperforming the benchmark on a volatility-adjusted basis; negative = underperforming. Strong/weak zones mark RRS beyond a configurable level.

Divergence (new):
Using pivots on the smoothed RRS, a bearish divergence is flagged when RRS makes a lower pivot high while price makes a higher high; bullish when RRS makes a higher pivot low while price makes a lower low.

Second-Benchmark Agreement (new):
Optionally compute RRS against a second benchmark and only confirm a zero-cross when both agree in sign — a confluence filter against single-benchmark noise.

Signal Cooldown (new):
A minimum bar gap between confirmed zero-cross signals to prevent clustering.

RRS Acceleration (new):
The bar-to-bar change in smoothed RRS, shown as a rising/falling momentum read in the dashboard.

What Is Original (Viprasol Additions)

1. RRS/price divergence detection (regular bullish and bearish).
2. Optional second-benchmark agreement filter on zero-cross signals.
3. Signal cooldown.
4. RRS acceleration (momentum-of-RRS) state.
5. Compact relative-strength dashboard.

Key Features

From the Original:
- ATR-normalised relative strength vs a benchmark
- EMA smoothing, zero-cross arrows, strong/weak zones, extreme background tint

Added in This Version (Viprasol):
- Divergence detection, dual-benchmark agreement, cooldown, acceleration read, dashboard
- Six alerts with dynamic {{ticker}}/{{close}}/{{interval}} messages

How to Use

1. Set the benchmark to match your asset class (SPY/QQQ stocks, IWM small-caps, BTCUSD crypto).
2. Above zero (aqua/green area) = outperforming; below zero (red area) = underperforming.
3. Zero-cross arrows mark fresh shifts; circles mark divergences; the strong/weak zones flag standout strength.

Recommended Starting Points:
- Intraday (15m-1H): Length 10-14
- Swing (Daily/4H): Length 14-20
- Use dual-benchmark agreement for higher-conviction crosses

These are starting points only — backtest and adjust before trading live.

Settings

Core: benchmark symbol, momentum length, ATR multiplier, RRS smoothing.
Confluence & Filters: 2nd-benchmark agreement (+ symbol), signal cooldown, strong/weak zone level.
Divergence: detect divergence toggle, pivot length.
Visuals: zero-cross arrows, RRS line, RRS area.
Dashboard: toggle and position.

Alerts

1. Bullish Cross — now outperforming the benchmark
2. Bearish Cross — now underperforming the benchmark
3. Strong Outperformance — RRS beyond the strong level
4. Strong Underperformance — RRS below the weak level
5. Bullish Divergence — RRS/price bullish divergence
6. Bearish Divergence — RRS/price bearish divergence

All alerts include {{ticker}}, {{close}}, and {{interval}}.

Limitations & Disclaimer

- RRS uses request.security for the benchmark; benchmark data quality and session alignment affect readings, especially across asset classes/exchanges.
- Divergence uses confirmed pivots, which lag by the pivot length.
- Relative strength shows leadership, not absolute direction — a rising RRS in a falling market only means the asset is falling less.
- Past performance does not guarantee future results. This indicator is for educational purposes only and is not financial advice. Always use proper risk management and test on historical data before trading live.

Credits & Attribution

Based on the open-source "Real Relative Strength" concept (community / SMB-style), which provided the ATR-normalised relative-momentum calculation, EMA smoothing, zero-cross signals, and strong/weak zones. Added by Viprasol: RRS/price divergence detection, optional second-benchmark agreement, signal cooldown, RRS acceleration, and the dashboard.

Published open-source per TradingView House Rules.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.