OPEN-SOURCE SCRIPT

Sector Rotation - Leadership Persistence [Dots3Red]

906
🔄 SECTOR ROTATION - LEADERSHIP PERSISTENCE [Dots3Red]
At any given time, some sectors are leading and others are lagging behind — traders call this rotation. This tool draws all eleven US sectors on one chart, normalized from the same starting point, so leadership and lag are visible at a glance instead of pieced together from eleven separate tabs.

WHY THIS MATTERS
This script adds a question that few answer: once a sector takes the lead, how long does that lead typically last before another sector overtakes it? And right now, given how long the current leader has already held the top spot, what are the odds it's still leading a bit further down the road?

📊 Avg Leadership: 14 bars (n=8)
📊 Leader Persists: 58% (n=8)

That's measured directly from this chart's own rotation history — not a general rule about how sectors "should" behave.


⚙️ HOW IT WORKS
🔄 Eleven sectors, one normalized view — all eleven SPDR Select Sector ETFs (Technology, Financials, Energy, Health Care, Industrials, Discretionary, Staples, Utilities, Materials, Real Estate, Communication Services) are plotted as cumulative percentage return from a common anchor point. Every line starts at zero and diverges from there, so the spread between the best and worst performer is the actual visual story.

Anchor options — Week, Month, or Quarter. All lines reset to zero at the start of each new period. Month is the standard window for rotation analysis, since it's long enough to show a real trend without being so long that early leadership becomes irrelevant.

👑 Leadership tracking — the sector with the highest normalized return at any moment is the current leader, marked with a star in both the end-of-chart label and the dashboard legend. Every time leadership changes hands, the duration the previous leader held the top spot is recorded, building a running average across every changeover this chart has produced.

🎯 Persistence grading — separately, each new leader is checked again a set number of bars later: is it still leading? The running percentage is a direct, honest answer to "once a sector takes over, how often does that lead actually hold up," specific to this chart's own history.

📋 Ranked dashboard legend — all eleven sectors, sorted by current performance, with each one's actual line color and live return percentage. This solves a real limitation of on-chart labels at the far right edge, which can get compressed or pushed off-screen depending on how the chart is sized — the dashboard legend is always fully readable regardless of zoom or pane width.

🧭 HOW TO USE
1️⃣ Read the spread, not just the top line. A wide gap between the leader and the rest signals strong rotation conviction; a tight cluster near zero signals an indecisive, rotation-less market.

2️⃣ Check "Led Since" alongside "Avg Leadership." If the current leader has already held the top spot longer than the historical average changeover duration, that's context worth noting — not a signal to act on, but a useful piece of the picture.

3️⃣ Use the persistence percentage to calibrate expectations, not to predict. "58% (n=8)" is a real but still-developing sample; treat it with more confidence once the changeover count grows.

4️⃣ Use the ranked legend as a quick market-breadth check. Seeing whether the top of the ranking is dominated by cyclical sectors (Discretionary, Industrials, Financials) versus defensive ones (Staples, Utilities, Real Estate) is itself a useful read on broad market risk appetite.

5️⃣ Match the anchor to your own time horizon. Week for a fast, tactical view; Month for the standard rotation window; Quarter for a slower, more structural read on which sectors have been dominant over a longer stretch.


🛠️ SETTINGS
Anchoring
• Rotation Anchor — Week / Month / Quarter
• Leadership Check Window — how many bars ahead a new leader is graded for persistence

🖥️ Dashboard
• Show/hide, position — current leader, leadership duration, average leadership length, persistence odds, changeover count, and the full ranked sector legend

📝 NOTES
This tool covers the eleven US SPDR Select Sector ETFs specifically — it does not cover international markets or custom sector groupings. Leadership and persistence statistics accumulate from when the indicator is added to the chart and become more meaningful as more changeovers occur; early on, expect small sample sizes.


⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical leadership duration and persistence rates do not guarantee how sector rotation will behave going forward.

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.