OPEN-SOURCE SCRIPT
RS Ratio vs Benchmark (Colored)

📈 RS Ratio vs Benchmark (with Color Change)
A simple but powerful tool to track relative strength against a benchmark like QQQ, SPY, or any other ETF.
🔍 What it Shows
RS Ratio (orange line): Measures how strong a stock is relative to a benchmark.
Moving Average (teal line): Smooths out RS to show trend direction.
Color-coded RS Line:
🟢 Green = RS is above its moving average → strength is increasing.
🔴 Red = RS is below its moving average → strength is fading.
📊 How to Read It
Above 100 = Stock is outperforming the benchmark.
Below 100 = Underperforming.
Rising & Green = Strongest signal — accelerating outperformance.
Above 100 but Red = Consolidating or losing momentum — potential rest period.
Crosses below 100 = Warning sign — underperformance.
✅ Best Uses
Spot leading stocks with strong momentum vs QQQ/SPY.
Identify rotation — when strength shifts between sectors.
Time entries and exits based on RS trends and crossovers.
A simple but powerful tool to track relative strength against a benchmark like QQQ, SPY, or any other ETF.
🔍 What it Shows
RS Ratio (orange line): Measures how strong a stock is relative to a benchmark.
Moving Average (teal line): Smooths out RS to show trend direction.
Color-coded RS Line:
🟢 Green = RS is above its moving average → strength is increasing.
🔴 Red = RS is below its moving average → strength is fading.
📊 How to Read It
Above 100 = Stock is outperforming the benchmark.
Below 100 = Underperforming.
Rising & Green = Strongest signal — accelerating outperformance.
Above 100 but Red = Consolidating or losing momentum — potential rest period.
Crosses below 100 = Warning sign — underperformance.
✅ Best Uses
Spot leading stocks with strong momentum vs QQQ/SPY.
Identify rotation — when strength shifts between sectors.
Time entries and exits based on RS trends and crossovers.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.