OPEN-SOURCE SCRIPT
Atualizado Industry Indices Comparison

A dynamic industry sector performance comparison indicator that helps traders and investors track relative strength across different market sectors in real-time.
- Compares up to 5 industry sector ETFs against a benchmark index (default: SPY)
- Displays key metrics including:
* Performance % over selected timeframe
* Relative performance vs benchmark
* Trend direction (▲ up, ▼ down, − neutral)
* Volume in millions (M) of shares traded
- Configurable timeframes: 1D, 1W, 1M, and 3M comparisons
- Color-coded performance indicators (green for outperformance, red for underperformance)
- Customizable table position and text size for optimal chart placement
The indicator helps identify:
1. Sector rotation patterns through relative performance
2. Leading and lagging sectors vs the broader market
3. Volume trends across different sectors
For traders, if you are considering two equally good setups, then choosing the setup belonging to a currently strong sector could be beneficial.
- Compares up to 5 industry sector ETFs against a benchmark index (default: SPY)
- Displays key metrics including:
* Performance % over selected timeframe
* Relative performance vs benchmark
* Trend direction (▲ up, ▼ down, − neutral)
* Volume in millions (M) of shares traded
- Configurable timeframes: 1D, 1W, 1M, and 3M comparisons
- Color-coded performance indicators (green for outperformance, red for underperformance)
- Customizable table position and text size for optimal chart placement
The indicator helps identify:
1. Sector rotation patterns through relative performance
2. Leading and lagging sectors vs the broader market
3. Volume trends across different sectors
For traders, if you are considering two equally good setups, then choosing the setup belonging to a currently strong sector could be beneficial.
Notas de Lançamento
PURPOSE:This indicator provides real-time analysis of major industry sectors' performance relative to the broader market, helping traders and investors identify sector rotation, market leadership, and potential trading opportunities.
KEY FEATURES:
1. Comprehensive Sector Coverage:
- Tracks 11 major S&P 500 sector ETFs: Technology (XLK), Financials (XLF), Energy (XLE), Healthcare (XLV), Industrials (XLI), Basic Materials (XLB), Consumer Staples (XLP), Consumer Discretionary (XLY), Real Estate (XLRE), Utilities (XLU), and Telecommunications (XLC)
- Compares each sector against a benchmark index (default: SPY)
2. Performance Metrics:
- Current Price: Real-time price for each sector ETF
- Performance %: Price change over selected timeframe (1D/1W/1M/3M)
- Relative Strength: Sector performance vs benchmark (outperform/underperform)
- Trend Indicator: Visual markers (▲ up, ▼ down, − neutral)
- Volume Analysis: Trading volume in millions of shares
3. Visual Features:
- Color-coded performance (Green = outperform, Red = underperform)
- Customizable table position (4 corner options)
- Adjustable text size (Tiny/Small/Normal)
- Clean, organized data presentation
REFERENCES & THEORY:
1. Market Trend Analysis:
- Dow Theory (Charles Dow): Markets move in trends; primary, secondary, and minor
- Reference: "Technical Analysis of Stock Trends" by Robert D. Edwards and John Magee
- Link: investopedia.com/terms/d/dowtheory.asp
2. Sector Rotation Model:
- Sam Stovall's Sector Rotation: Sectors move in predictable patterns through economic cycles
- Reference: "Standard & Poor's Guide to Sector Investing" by Sam Stovall
- Economic Cycle Stages:
* Early Recession: Consumer Staples, Utilities, Healthcare
* Full Recession: Consumer Staples, Utilities
* Early Recovery: Technology, Basic Materials, Industrials
* Full Recovery: Energy, Materials, Industrials
- Link: investopedia.com/articles/trading/05/020305.asp
3. Relative Strength Theory:
- Developed by J. Welles Wilder Jr.
- Reference: "New Concepts in Technical Trading Systems"
- Principle: Strong sectors tend to stay strong; momentum persists
- Link: investopedia.com/terms/r/relativestrength.asp
4. Volume Analysis:
- Richard Wyckoff's Market Theory
- Reference: "Studies in Tape Reading" by Richard D. Wyckoff
- Importance of volume confirmation in trend analysis
- Link: investopedia.com/articles/active-trading/070715/making-money-wyckoff-way.asp
5. Modern Applications:
- "Intermarket Analysis" by John J. Murphy
- "Trading with Intermarket Analysis" by John J. Murphy
- Explains relationships between different market sectors
- Link: investopedia.com/terms/i/intermarket-analysis.asp
HOW IT WORKS:
1. Data Collection:
- Fetches real-time price and volume data for each sector ETF
- Calculates performance over user-selected timeframe
- Computes relative performance against benchmark
2. Analysis:
- Determines sector trends based on price movement
- Identifies outperforming/underperforming sectors
- Monitors volume patterns for confirmation
3. Display:
- Organizes data in an easy-to-read table format
- Updates continuously during market hours
- Highlights important metrics through color coding
PRACTICAL APPLICATIONS:
1. Sector Rotation Strategy:
- Identify which sectors are leading/lagging
- Spot early signs of sector rotation
- Time sector-based trades
2. Risk Management:
- Monitor sector exposure
- Identify market trends through sector performance
- Validate broader market moves
3. Portfolio Management:
- Guide sector allocation decisions
- Identify potential sector opportunities
- Track sector momentum
USAGE INSTRUCTIONS:
1. Setup:
- Add indicator to your chart
- Select preferred benchmark (default: SPY)
- Choose comparison timeframe (1D/1W/1M/3M)
- Adjust table position and text size if needed
2. Analysis:
- Green/Red colors show outperformance/underperformance
- Use trend arrows for quick direction reference
- Compare volume patterns with price movement
- Monitor relative performance vs benchmark
3. Trading Applications:
- Long opportunities: Focus on outperforming sectors
- Short opportunities: Consider underperforming sectors
- Pair trades: Compare related sectors
- Sector rotation: Track performance shifts
CUSTOMIZATION OPTIONS:
- Benchmark Selection: Choose any market index
- Timeframe: Select from 1D, 1W, 1M, or 3M comparisons
- Visual Settings: Adjust table position, text size, and colors
- Sector Names: Customize display names for each sector
This indicator is ideal for traders and investors who want to:
- Make informed sector-based trading decisions
- Understand market dynamics through sector analysis
- Implement sector rotation strategies
- Monitor sector-specific opportunities
- Validate broader market trends
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Para acesso rápido no gráfico, adicione esse script para seus favoritos — saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Para acesso rápido no gráfico, adicione esse script para seus favoritos — saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.