OPEN-SOURCE SCRIPT
RS Rating Multi-Timeframe v2

RS Rating Multi-Timeframe
A relative strength rating indicator modeled after IBD's proprietary RS Rating system. This indicator measures a stock's price performance relative to the S&P 500 (or any benchmark you choose) and converts it to a 1-99 rating scale.
How It Works
The indicator calculates weighted performance ratios across four timeframes:
40% weight: 63-day (3-month) performance
20% weight: 126-day (6-month) performance
20% weight: 189-day (9-month) performance
20% weight: 252-day (12-month) performance
This weighting emphasizes recent performance while still accounting for longer-term strength—the same methodology used by leading growth stock research services.
Rating Scale
90-99: Elite relative strength (top 10% of stocks)
80-89: Strong relative strength (top 20%)
50-79: Average performance
30-49: Below average
1-29: Weak relative strength (bottom 30%)
Features
Customizable benchmark index (default: S&P 500)
Optional moving average overlay (EMA or SMA)
Visual zones with color-coded backgrounds
Signal markers when RS crosses key thresholds (80 and 30)
Info table showing current rating, daily change, MA value, and raw score
Built-in alerts for threshold crossovers
Pine Screener Compatible
This indicator includes state-based plots specifically designed for TradingView's Pine Screener. You can screen watchlists for:
RS Above 90, 80, 70, or 50
RS Below 50 or 30
RS Above/Below its moving average
Custom thresholds using the raw RS Rating value
In the Pine Screener, select the "Screener RS Above 80" output and set it to "True" (or equals 1) to find all stocks currently above 80—not just those crossing on that bar.
Usage Tips
Growth investors typically look for stocks with RS Ratings above 80, indicating the stock is outperforming 80% of the market. Combining high RS Rating with other technical signals (breakouts, volume, moving averages) can help identify leading stocks.
A relative strength rating indicator modeled after IBD's proprietary RS Rating system. This indicator measures a stock's price performance relative to the S&P 500 (or any benchmark you choose) and converts it to a 1-99 rating scale.
How It Works
The indicator calculates weighted performance ratios across four timeframes:
40% weight: 63-day (3-month) performance
20% weight: 126-day (6-month) performance
20% weight: 189-day (9-month) performance
20% weight: 252-day (12-month) performance
This weighting emphasizes recent performance while still accounting for longer-term strength—the same methodology used by leading growth stock research services.
Rating Scale
90-99: Elite relative strength (top 10% of stocks)
80-89: Strong relative strength (top 20%)
50-79: Average performance
30-49: Below average
1-29: Weak relative strength (bottom 30%)
Features
Customizable benchmark index (default: S&P 500)
Optional moving average overlay (EMA or SMA)
Visual zones with color-coded backgrounds
Signal markers when RS crosses key thresholds (80 and 30)
Info table showing current rating, daily change, MA value, and raw score
Built-in alerts for threshold crossovers
Pine Screener Compatible
This indicator includes state-based plots specifically designed for TradingView's Pine Screener. You can screen watchlists for:
RS Above 90, 80, 70, or 50
RS Below 50 or 30
RS Above/Below its moving average
Custom thresholds using the raw RS Rating value
In the Pine Screener, select the "Screener RS Above 80" output and set it to "True" (or equals 1) to find all stocks currently above 80—not just those crossing on that bar.
Usage Tips
Growth investors typically look for stocks with RS Ratings above 80, indicating the stock is outperforming 80% of the market. Combining high RS Rating with other technical signals (breakouts, volume, moving averages) can help identify leading stocks.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.