OPEN-SOURCE SCRIPT
已更新 Sector Rotation Dashboardr

Sector Rotation Dashboard
Understanding where institutional money is moving before and after the opening bell gives traders a massive edge. This indicator is a real-time capital rotation tracker that maps the relative performance of all 11 Select Sector SPDR ETFs (representing the entire S&P 500) across all trading sessions.
Unlike standard dashboards that only look at regular market data, this script dynamically loops in premarket and after-hours data, updating relative performance calculations dynamically on every tick.
How It Works
The script actively fetches performance data by comparing the current extended hours or regular session price against the previous regular session close. It automatically pulls and handles 11 critical market sectors:
Technology (XLK)
Financials (XLF)
Health Care (XLV)
Consumer Discretionary (XLY)
Consumer Staples (XLP)
Energy (XLE)
Utilities (XLU)
Industrials (XLI)
Materials (XLB)
Real Estate (XLRE)
Communication Services (XLC)
Key Features
Live Session Tracking: Built-in intelligence automatically detects whether the market is in Premarket Hours, Regular Market Hours, or After Hours based on exchange times.
Real-time Bubble Sort Engine: The script actively sorts the 11 sectors from strongest to weakest on the last bar, so the leading sectors are always pushed to the top of your UI.
Automated Capital Rotation Insight: At the bottom of the table, a dynamic AI-style macro text block summarizes the state of the market. For example, it might read: "During Premarket Hours, capital is rotating heavily into Technology (XLK)... Conversely, liquidity is draining from Utilities (XLU)."
Fully Customizable UI: Change the dashboard placement (Top Right, Bottom Left, etc.) and text scaling seamlessly via the script settings to perfectly fit your workspace layout.
How to Trade with It
Spot Early Momentum (Premarket): Look at the dashboard 30–60 minutes before the open. If Defensive sectors (XLU, XLP) are leading while Aggressive sectors (XLK, XLY) are bleeding liquidity, expect a risk-off environment at the opening bell.
Relative Strength / Weakness Trading: When looking for long setups, focus on individual stocks inside the top 2 leading sectors. For shorting or put options, look at names within the lagging bottom sectors.
Identify Intraday Rotations: Watch for shifts during regular market hours where a beaten-down sector suddenly starts climbing the ladder, signaling algorithmic or institutional accumulation.
Developer Note: Uses optimized request.security structures to pull seamless extended historical data without dragging down chart loading speeds or causing layout shifting.
Understanding where institutional money is moving before and after the opening bell gives traders a massive edge. This indicator is a real-time capital rotation tracker that maps the relative performance of all 11 Select Sector SPDR ETFs (representing the entire S&P 500) across all trading sessions.
Unlike standard dashboards that only look at regular market data, this script dynamically loops in premarket and after-hours data, updating relative performance calculations dynamically on every tick.
How It Works
The script actively fetches performance data by comparing the current extended hours or regular session price against the previous regular session close. It automatically pulls and handles 11 critical market sectors:
Technology (XLK)
Financials (XLF)
Health Care (XLV)
Consumer Discretionary (XLY)
Consumer Staples (XLP)
Energy (XLE)
Utilities (XLU)
Industrials (XLI)
Materials (XLB)
Real Estate (XLRE)
Communication Services (XLC)
Key Features
Live Session Tracking: Built-in intelligence automatically detects whether the market is in Premarket Hours, Regular Market Hours, or After Hours based on exchange times.
Real-time Bubble Sort Engine: The script actively sorts the 11 sectors from strongest to weakest on the last bar, so the leading sectors are always pushed to the top of your UI.
Automated Capital Rotation Insight: At the bottom of the table, a dynamic AI-style macro text block summarizes the state of the market. For example, it might read: "During Premarket Hours, capital is rotating heavily into Technology (XLK)... Conversely, liquidity is draining from Utilities (XLU)."
Fully Customizable UI: Change the dashboard placement (Top Right, Bottom Left, etc.) and text scaling seamlessly via the script settings to perfectly fit your workspace layout.
How to Trade with It
Spot Early Momentum (Premarket): Look at the dashboard 30–60 minutes before the open. If Defensive sectors (XLU, XLP) are leading while Aggressive sectors (XLK, XLY) are bleeding liquidity, expect a risk-off environment at the opening bell.
Relative Strength / Weakness Trading: When looking for long setups, focus on individual stocks inside the top 2 leading sectors. For shorting or put options, look at names within the lagging bottom sectors.
Identify Intraday Rotations: Watch for shifts during regular market hours where a beaten-down sector suddenly starts climbing the ladder, signaling algorithmic or institutional accumulation.
Developer Note: Uses optimized request.security structures to pull seamless extended historical data without dragging down chart loading speeds or causing layout shifting.
發行說明
Fixed chart display發行說明
Fixing chart開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。