OPEN-SOURCE SCRIPT
[Viprasol] Real Relative Strength

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.
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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Viprasol We solve Infinity
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Viprasol We solve Infinity
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
Whatsapp +919633652112
Lets do it Together All Automation Solutions Available
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.