OPEN-SOURCE SCRIPT
Dynamic RVOL Sector Rotation

The Concept: Tracking Institutional Capital Flow
The market is a constant game of musical chairs. Capital doesn't just leave the market; it rotates. When institutions dump Tech (XLK), they are usually parking that capital into defensive sectors like Utilities (XLU) or Healthcare (XLV).
The problem most retail traders face is that they don't spot this rotation until the financial news reports on it hours later. By then, the move has already been made, and the options premiums are blown out.
The Dynamic RVOL Sector Rotation Dashboard was built to solve this. It tracks the 11 major SPDR Sector ETFs simultaneously, scanning for unusual Relative Volume (RVOL) spikes and cross-referencing them against daily trends and daily ATR exhaustion. It dynamically auto-sorts the data on every tick, pushing the sector with the most aggressive capital inflow directly to the top of your screen.
How the Engine Works
This indicator leverages Pine Script v6 arrays to process 44 different data points in real-time. It completely detaches from your active chart's timeframe, allowing you to day-trade on a 1-minute chart while the engine quietly hunts for macro hourly or daily rotations in the background.
The dashboard tracks 5 key metrics:
SECTOR: The 11 core SPDR ETFs (XLK, XLY, XLC, XLF, XLV, XLI, XLE, XLP, XLRE, XLB, XLU).
RVOL (Relative Volume): Compares current volume to the historical moving average. When a sector hits >= 1.5x normal volume, the cell turns Yellow to flag institutional activity.
% CHG: Standard intraday price change.
% ATR (Average True Range Exhaustion): This is the options pricing filter. It calculates how far the daily candle has traveled compared to its normal 14-day ATR. If a sector has already moved 80%+ of its normal daily range, the cell turns Orange, warning you that the move is mathematically exhausted and options premiums are heavily inflated.
TREND: Pulls the Daily 21 EMA to confirm macro direction. If the intraday volume spike aligns with the macro trend, it prints UP (Green). If it is counter-trend, it prints DOWN (Red).
The Playbook (How to Trade It)
Do not buy blindly just because a sector hits the top of the list. Look for data confluence:
The Golden Setup (Continuation): A sector snaps to the top row. RVOL is Yellow (Capital is flowing in). Trend is UP (Aligning with the macro trend). % ATR is White (Under 80% — the move still has room to run). This indicates a high-probability rotation with reasonable options premiums.
The Premium Trap (Exhaustion): A sector hits the top with massive Yellow RVOL, but the % ATR column is Orange (Over 80%). The move is valid, but the daily fuel is gone. Avoid chasing straight long calls here; look for pullbacks or structured spreads.
The Fakeout (Short Covering): A sector spikes to the top with Green price action and Yellow RVOL, but the Trend column is DOWN. This is likely a dead-cat bounce or short-covering rally, not a true macro rotation. Look to short the intraday pop at resistance.
Customization & Alerts
Fully Resizable & Movable: Use the settings menu to snap the dashboard to any corner of your screen and adjust the text size.
Independent Timeframes: You can decouple the scanner from your chart. Set the scanner to look for 1-Hour rotations while you trade on a 5-minute chart.
The "Golden Setup" Alert Engine: You don't need to stare at the screen. Create an alert for this indicator, select "Any alert() function call", and the script will dynamically ping you with a text message (e.g., "GOLDEN SETUP DETECTED: Capital rotating into XLI") ONLY when a sector perfectly aligns with high RVOL, green price action, safe ATR, and an upward macro trend.
Disclaimer: This script is an educational tool for tracking volume and statistical data. It is not financial advice. Always do your own due diligence before deploying capital.
The market is a constant game of musical chairs. Capital doesn't just leave the market; it rotates. When institutions dump Tech (XLK), they are usually parking that capital into defensive sectors like Utilities (XLU) or Healthcare (XLV).
The problem most retail traders face is that they don't spot this rotation until the financial news reports on it hours later. By then, the move has already been made, and the options premiums are blown out.
The Dynamic RVOL Sector Rotation Dashboard was built to solve this. It tracks the 11 major SPDR Sector ETFs simultaneously, scanning for unusual Relative Volume (RVOL) spikes and cross-referencing them against daily trends and daily ATR exhaustion. It dynamically auto-sorts the data on every tick, pushing the sector with the most aggressive capital inflow directly to the top of your screen.
How the Engine Works
This indicator leverages Pine Script v6 arrays to process 44 different data points in real-time. It completely detaches from your active chart's timeframe, allowing you to day-trade on a 1-minute chart while the engine quietly hunts for macro hourly or daily rotations in the background.
The dashboard tracks 5 key metrics:
SECTOR: The 11 core SPDR ETFs (XLK, XLY, XLC, XLF, XLV, XLI, XLE, XLP, XLRE, XLB, XLU).
RVOL (Relative Volume): Compares current volume to the historical moving average. When a sector hits >= 1.5x normal volume, the cell turns Yellow to flag institutional activity.
% CHG: Standard intraday price change.
% ATR (Average True Range Exhaustion): This is the options pricing filter. It calculates how far the daily candle has traveled compared to its normal 14-day ATR. If a sector has already moved 80%+ of its normal daily range, the cell turns Orange, warning you that the move is mathematically exhausted and options premiums are heavily inflated.
TREND: Pulls the Daily 21 EMA to confirm macro direction. If the intraday volume spike aligns with the macro trend, it prints UP (Green). If it is counter-trend, it prints DOWN (Red).
The Playbook (How to Trade It)
Do not buy blindly just because a sector hits the top of the list. Look for data confluence:
The Golden Setup (Continuation): A sector snaps to the top row. RVOL is Yellow (Capital is flowing in). Trend is UP (Aligning with the macro trend). % ATR is White (Under 80% — the move still has room to run). This indicates a high-probability rotation with reasonable options premiums.
The Premium Trap (Exhaustion): A sector hits the top with massive Yellow RVOL, but the % ATR column is Orange (Over 80%). The move is valid, but the daily fuel is gone. Avoid chasing straight long calls here; look for pullbacks or structured spreads.
The Fakeout (Short Covering): A sector spikes to the top with Green price action and Yellow RVOL, but the Trend column is DOWN. This is likely a dead-cat bounce or short-covering rally, not a true macro rotation. Look to short the intraday pop at resistance.
Customization & Alerts
Fully Resizable & Movable: Use the settings menu to snap the dashboard to any corner of your screen and adjust the text size.
Independent Timeframes: You can decouple the scanner from your chart. Set the scanner to look for 1-Hour rotations while you trade on a 5-minute chart.
The "Golden Setup" Alert Engine: You don't need to stare at the screen. Create an alert for this indicator, select "Any alert() function call", and the script will dynamically ping you with a text message (e.g., "GOLDEN SETUP DETECTED: Capital rotating into XLI") ONLY when a sector perfectly aligns with high RVOL, green price action, safe ATR, and an upward macro trend.
Disclaimer: This script is an educational tool for tracking volume and statistical data. It is not financial advice. Always do your own due diligence before deploying capital.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
You can always take more, you can never take less.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
You can always take more, you can never take less.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.