OPEN-SOURCE SCRIPT

Sector Rotation & Money Flow Dashboard

573
📊 Overview
The Sector Rotation & Money Flow Dashboard is a comprehensive market analysis tool that tracks 39 major sector ETFs in real-time, providing institutional-grade insights into sector rotation, momentum shifts, and money flow patterns. This indicator helps traders identify which sectors are attracting capital, which are losing favor, and where the next opportunities might emerge.
Perfect for swing traders, position traders, and investors who want to stay ahead of sector rotation and ride the strongest trends while avoiding weak sectors.

🎯 What This Indicator Does
Tracks 39 Major Sectors: From technology to utilities, cryptocurrencies to commodities
Calculates Multiple Timeframes: 1-week, 1-month, 3-month, and 6-month performance
Advanced Momentum Metrics: Proprietary momentum score and acceleration calculations
Relative Strength Analysis: Compare sector performance against any benchmark index
Money Flow Signals: Visual indicators showing where institutional money is moving
Smart Filtering: Pre-built strategy filters for different trading styles
Trend Detection: Emoji-based visual system for quick trend identification

💡 Key Features
1. Performance Metrics

Multiple timeframe analysis (1W, 1M, 3M, 6M)
Month-over-month change tracking
Relative strength vs benchmark index

2. Advanced Analytics
Momentum Score: Weighted composite of recent performance
Acceleration: Rate of change in momentum (second derivative)
Money Flow Signals: IN/OUT/TURN/WATCH indicators

3. Strategy Preset Filters
🎯 Swing Trade: High momentum opportunities
📈 Trend Follow: Established uptrends
🔄 Mean Reversion: Oversold bounce candidates
💎 Value Hunt: Deep value opportunities
🚀 Breakout: Emerging strength
⚠️ Risk Off: Sectors to avoid

4. Customization
All 39 sector ETFs can be customized
Adjustable benchmark index
Flexible display options
Multiple sorting methods

📋 Settings Documentation
Display Settings
Show Table (Default: On)

Toggles the entire dashboard display

Table Position (Default: Middle Center)

Choose from 9 positions on your chart
Options: Top/Middle/Bottom × Left/Center/Right

Rows to Show (Default: 15)

Number of sectors displayed (5-40)
Useful for focusing on top/bottom performers

Sort By (Default: Momentum)

1M/3M/6M: Sort by specific timeframe performance
Momentum: Weighted recent performance score
Acceleration: Rate of momentum change
1M Change: Month-over-month improvement
RS: Relative strength vs benchmark
Flow: IN First: Prioritize sectors with inflows
Flow: TURN First: Focus on reversal candidates
Recovery Plays: Oversold sectors recovering
Oversold Bounce: Deepest declines with positive signs
Top Gainers/Losers 3M: Best/worst quarterly performers
Best Acc + Mom: Combined strength score
Worst Acc (Topping): Sectors losing momentum

Filter Settings
Strategy Preset Filter (Default: All)

All: No filtering
🎯 Swing Trade: Mom >5, Acc >2, Money flowing in
📈 Trend Follow: Positive 1M & 3M, RS >0
🔄 Mean Reversion: Oversold but improving
💎 Value Hunt: Down >10% with recovery signs
🚀 Breakout: Rapid momentum surge
⚠️ Risk Off: Declining or topping sectors
Custom Flow Filter: Use manual flow filter

Custom Flow Signal Filter (Default: All)

Only active when Strategy Preset = "Custom Flow Filter"
IN Only: Strong inflows
TURN Only: Reversal signals
WATCH Only: Recovery candidates
OUT Only: Outflow sectors
Active Flows Only: Any non-neutral signal

Hide Low Volume ETFs (Default: Off)

Filters out illiquid sectors (future enhancement)

Visual Settings
Show Trend Emojis (Default: On)

🚀 Breakout (Strong 1M + High Acceleration)
🔥 Hot Recovery (From -10% to positive)
💪 Steady Uptrend (All timeframes positive)
➡️ Sideways/Ranging
⚠️ Warning/Topping (Up >15%, now slowing)
📉 Falling (Negative + declining)
🔄 Bottoming (Improving from lows)

Compact Mode (Default: Off)

Removes decimals for cleaner display
Useful when showing many rows

Min Data Points Required (Default: 3)

Minimum data points needed to display a sector
Prevents showing sectors with insufficient data

Relative Strength Settings
RS Benchmark Index (Default: AMEX:SPY)

Index to compare all sectors against
Can use SPY, QQQ, IWM, or any other index

RS Period (Days) (Default: 21)

Lookback period for RS calculation
21 days = 1 month, 63 days = 3 months, etc.

Sector ETF Settings (Groups 1-39)
Each sector has two inputs:

Symbol: The ticker (e.g., "AMEX:XLF")
Name: Display name (e.g., "Financials")

All 39 sectors can be customized to track different ETFs or markets.

📈 Column Explanations

Sector: ETF name/description
1M%: 1-month (21-day) performance
3M%: 3-month (63-day) performance
6M%: 6-month (126-day) performance
Mom: Momentum score (weighted average, recent-biased)
Acc: Acceleration (momentum rate of change)
Δ1M: Month-over-month change
RS: Relative strength vs benchmark
Flow: Money flow signal

↗️ IN: Strong inflows
🔄 TURN: Potential reversal
👀 WATCH: Recovery candidate
↘️ OUT: Outflows
—: Neutral

🎮 Usage Tips
For Swing Traders (3-14 days)

Use "🎯 Swing Trade" filter
Sort by "Acceleration" or "Momentum"
Look for Flow = "IN" and Mom >10
Confirm with positive RS

For Position Traders (2-8 weeks)

Use "📈 Trend Follow" filter
Sort by "RS" or "Best Acc + Mom"
Focus on consistent green across timeframes
Ensure RS >3 for market leaders

For Value Investors

Use "💎 Value Hunt" filter
Sort by "Recovery Plays" or "Top Losers 3M"
Look for improving Δ1M
Check for "WATCH" or "TURN" signals

For Risk Management

Regularly check "⚠️ Risk Off" filter
Sort by "Worst Acc (Topping)"
Review holdings for ⚠️ warning emojis
Exit sectors showing "OUT" flow

Market Regime Recognition

Bull Market: Many sectors showing "IN" flow, positive RS
Bear Market: Widespread "OUT" flows, negative RS
Rotation: Mixed flows, some "IN" while others "OUT"
Recovery: Multiple "TURN" and "WATCH" signals

🔧 Pro Tips

Combine Filters + Sorting: Filter first to narrow candidates, then sort to prioritize
Multi-Timeframe Confirmation: Best setups show alignment across 1M, 3M, and momentum
RS is Key: Sectors outperforming SPY (RS >0) tend to continue outperforming
Acceleration Matters: Positive acceleration often precedes price breakouts
Flow Transitions: "WATCH" → "TURN" → "IN" progression identifies new trends early
Regular Scans:

Daily: Check "Acceleration" sort
Weekly: Review "1M Change"
Monthly: Analyze "RS" shifts

Divergence Signals:
Price up but Acceleration down = Potential top
Price down but Acceleration up = Potential bottom

Sector Pairs Trading: Long sectors with "IN" flow, short sectors with "OUT" flow

⚠️ Important Notes
This indicator makes 40 security requests (maximum allowed)
Best used on Daily timeframe
Data updates in real-time during market hours
Some ETFs may show "—" if data is unavailable

🎯 Common Strategies
"Follow the Flow"
Only trade sectors showing "IN" flow with positive RS
"Rotation Catcher"
Focus on "TURN" signals in sectors down >15% from highs
"Momentum Rider"
Trade top 3 sectors by Momentum score, exit when Acceleration turns negative
"Mean Reversion"
Buy sectors in bottom 20% by 3M performance when Δ1M improves
"Relative Strength Leader"
Maintain positions only in sectors with RS >5

Not financial advice - always do additional research

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.