OPEN-SOURCE SCRIPT

RS Rating Multi-Timeframe MAs

69
RS Rating Multi-Timeframe MAs
A relative strength rating indicator that measures how a stock performs against a benchmark index (default: S&P 500), displayed as a 1-99 rating with five customizable multi-timeframe moving averages for trend analysis and crossover signals.

What is RS Rating?
The RS (Relative Strength) Rating compares a stock's price performance to a benchmark index over four weighted time periods:

63 days (1 quarter) — 40% weight
126 days (2 quarters) — 20% weight
189 days (3 quarters) — 20% weight
252 days (1 year) — 20% weight

The raw relative strength score is then converted to a 1-99 rating scale, where higher values indicate stronger outperformance versus the benchmark.

Rating Zones

90-99 (Elite): Exceptional relative strength, top performers
80-89 (Strong): Solid outperformance, institutional quality
50-79 (Neutral): Average performance relative to benchmark
30-49 (Weak): Underperforming the market
1-29 (Laggard): Significant underperformance


Multi-Timeframe Moving Averages
This indicator includes five fully customizable moving averages, each operating on its own timeframe:
MADefault TimeframeDefault LengthPurposeMA11 Hour5Fastest, short-term momentumMA24 Hour5Intraday trendMA3Daily10Swing trade referenceMA4Weekly4Intermediate trendMA5Monthly3Long-term trend, slowest
Each MA can be configured with:

Custom timeframe
Custom length
SMA or EMA calculation
Individual color


Crossover Signals
Select two MA pairs to monitor for crossover signals:

Cross Pair 1: Triangles (lime up / red down)
Cross Pair 2: Circles (aqua up / orange down)

Common configurations:

MA1/MA2 for fast scalp signals
MA2/MA3 for swing entries
MA3/MA4 for trend confirmation
MA4/MA5 for major trend changes


Stack Alignment
When all five MAs align in order (fastest to slowest), the background highlights the trend:

Green background: Bullish stack (MA1 > MA2 > MA3 > MA4 > MA5)
Red background: Bearish stack (MA1 < MA2 < MA3 < MA4 < MA5)

This identifies strong trending conditions where momentum aligns across all timeframes.

Information Table
The top-right table displays:

Current RS Rating with color coding
Trend status (Bullish / Bearish / Mixed)
All five MA values
Whether RS Rating is above (▲) or below (▼) each MA
Raw RS score for reference


Alerts

Cross Pair 1 Bullish/Bearish
Cross Pair 2 Bullish/Bearish
Bullish Stack Alignment
Bearish Stack Alignment
RS Above 80
RS Below 30


How to Use

Trend Following: Look for stocks with RS Rating above 80 and bullish MA stack alignment
Pullback Entries: When RS Rating pulls back to a rising MA3 (daily) in an uptrend
Trend Reversals: Watch for MA crossovers combined with RS Rating crossing key thresholds (80/30)
Avoid Laggards: Stocks with RS below 30 and bearish stack alignment are underperforming


Settings

Benchmark Index: Change the comparison index (default: SP:SPX)
MA 1-5: Configure timeframe, length, type, and color for each moving average
Signal Pairs: Select which MA pairs trigger crossover signals
Display Options: Toggle table and individual MAs on/off


Credits
Based on the IBD Relative Strength Rating methodology with multi-timeframe MA enhancements for active traders.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.