OPEN-SOURCE SCRIPT
Sector Rotation Radar XL Dashboard

This script is a compact sector rotation dashboard built around the classic *SPDR sector ETFs (XL)**. It ranks sectors by a weighted Relative Strength score versus a benchmark (default: SPY) and adds quick context via trend/breadth filters.
What it shows
• Top R.: Top/bottom “heat” badge (🔥 / ❄ / ▫️) + current rank
• Sector: Icon + ticker + sector name (e.g., 🔋
XLE (Energy))
• Δ (Rank change): Rank movement vs a user-defined lookback
• MA50 / MA200: ✅ / ❌ plus % distance above/below each MA
• Score: Weighted RS momentum score (multi-lookback)
• RS/SPY: Relative Strength ratio vs the benchmark
• YTD: Year-to-date performance (fixed to 1 decimal)
Breadth row (Market State)
The header line shows MA200 breadth (how many sectors are above their MA200), a simple Risk-on / Risk-off / Neutral label based on thresholds, and the change vs the prior bar.
How to use (practical)
• Use the rank + score to identify sector leadership/weakness.
• Use Δ to spot rotation in progress (leaders gaining/losing rank).
• Use MA50/MA200 % distance to confirm trend alignment and avoid chasing extended moves.
• Use breadth to understand whether leadership is broad or narrow.
Settings
• Benchmark symbol (default SPY)
• Compute on Current TF or Weekly
• Lookbacks + weights for the Score
• ΔRank lookback
• Table position / padding / font size / colors
• Universe presets (All / Cyclical / Defensive) + per-sector toggles
• Optional alerts: Leader change, Top 3 change, Risk-on/off flips
Notes / Disclaimer
This indicator is for educational and informational purposes only. It does not provide trade signals or recommendations. Always do your own research, confirm with additional tools, and manage risk appropriately.
What it shows
• Top R.: Top/bottom “heat” badge (🔥 / ❄ / ▫️) + current rank
• Sector: Icon + ticker + sector name (e.g., 🔋
• Δ (Rank change): Rank movement vs a user-defined lookback
• MA50 / MA200: ✅ / ❌ plus % distance above/below each MA
• Score: Weighted RS momentum score (multi-lookback)
• RS/SPY: Relative Strength ratio vs the benchmark
• YTD: Year-to-date performance (fixed to 1 decimal)
Breadth row (Market State)
The header line shows MA200 breadth (how many sectors are above their MA200), a simple Risk-on / Risk-off / Neutral label based on thresholds, and the change vs the prior bar.
How to use (practical)
• Use the rank + score to identify sector leadership/weakness.
• Use Δ to spot rotation in progress (leaders gaining/losing rank).
• Use MA50/MA200 % distance to confirm trend alignment and avoid chasing extended moves.
• Use breadth to understand whether leadership is broad or narrow.
Settings
• Benchmark symbol (default SPY)
• Compute on Current TF or Weekly
• Lookbacks + weights for the Score
• ΔRank lookback
• Table position / padding / font size / colors
• Universe presets (All / Cyclical / Defensive) + per-sector toggles
• Optional alerts: Leader change, Top 3 change, Risk-on/off flips
Notes / Disclaimer
This indicator is for educational and informational purposes only. It does not provide trade signals or recommendations. Always do your own research, confirm with additional tools, and manage risk appropriately.
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.
Setup + Risk Management + 1% better daily = Consistency. 📈
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.
Setup + Risk Management + 1% better daily = Consistency. 📈
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.