OPEN-SOURCE SCRIPT
RRG Relative Strength

# RRG Relative Strength (RRG RS)
Compare any symbol to a benchmark using two RRG-style lines: **RS-Ratio** (trend of relative strength) and **RS-Momentum** (momentum of that trend). Both are centered at **100**:
- **RS-Ratio > 100** → outperforming the benchmark
- **RS-Ratio < 100** → underperforming
- **RS-Momentum** often **leads** RS-Ratio (crosses 100 earlier)
# How it works
1) Relative Strength (RS): RS = Close(symbol) / Close(benchmark)
2) Normalize around 100: smooth RS with EMA and divide RS by that EMA
3) RS-Ratio: EMA( RS / EMA(RS, Length), LenSmooth ) * 100
4) RS-Momentum: RS-Ratio / EMA(RS-Ratio, LenSmooth) * 100
# Inputs
- Length (default 14): normalization window for RS
- Length Smooth (default 20): smoothing window for RS-Ratio & RS-Momentum
# Benchmark (auto)
- US: SP:SPX (S&P 500)
- Vietnam: HOSE:VNINDEX
- Crypto: INDEX:BTCUSD
(Modify the mapping if needed, or replace with your own input.symbol().)
# How to read
- Improving: RS-Momentum crosses above 100 while RS-Ratio turns up
- Leading: RS-Ratio > 100 with RS-Momentum ≥ 100
- Weakening: RS-Momentum drops below 100; RS-Ratio often follows
# Timeframes & presets
- Works on Daily and Weekly charts
- Daily (fast): 14 / 20
- Approx. weekly behavior on Daily: 50 / 60
Note: Values usually hover near 100 (e.g., ~90–110) but are not strictly bounded. Ensure your symbol and benchmark trade in comparable sessions/currencies.
Compare any symbol to a benchmark using two RRG-style lines: **RS-Ratio** (trend of relative strength) and **RS-Momentum** (momentum of that trend). Both are centered at **100**:
- **RS-Ratio > 100** → outperforming the benchmark
- **RS-Ratio < 100** → underperforming
- **RS-Momentum** often **leads** RS-Ratio (crosses 100 earlier)
# How it works
1) Relative Strength (RS): RS = Close(symbol) / Close(benchmark)
2) Normalize around 100: smooth RS with EMA and divide RS by that EMA
3) RS-Ratio: EMA( RS / EMA(RS, Length), LenSmooth ) * 100
4) RS-Momentum: RS-Ratio / EMA(RS-Ratio, LenSmooth) * 100
# Inputs
- Length (default 14): normalization window for RS
- Length Smooth (default 20): smoothing window for RS-Ratio & RS-Momentum
# Benchmark (auto)
- US: SP:SPX (S&P 500)
- Vietnam: HOSE:VNINDEX
- Crypto: INDEX:BTCUSD
(Modify the mapping if needed, or replace with your own input.symbol().)
# How to read
- Improving: RS-Momentum crosses above 100 while RS-Ratio turns up
- Leading: RS-Ratio > 100 with RS-Momentum ≥ 100
- Weakening: RS-Momentum drops below 100; RS-Ratio often follows
# Timeframes & presets
- Works on Daily and Weekly charts
- Daily (fast): 14 / 20
- Approx. weekly behavior on Daily: 50 / 60
Note: Values usually hover near 100 (e.g., ~90–110) but are not strictly bounded. Ensure your symbol and benchmark trade in comparable sessions/currencies.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。