OPEN-SOURCE SCRIPT
Actualizado Sector Tag (ETF Mapper)

The Sector Tag (ETF Mapper) is a TradingView utility designed to instantly identify the most relevant sector ETF for a stock. The indicator displays the corresponding sector directly on the chart, helping traders evaluate sector alignment, market context, and relative strength opportunities.
Coverage
The current database contains approximately 1,300+ US-listed stocks, including:
S&P 500 constituents
Nasdaq 100 constituents
Russell 2000 constituents
Additional actively traded swing and day trading stocks
High-volume growth, momentum, and earnings candidates
The ticker database is manually curated and can be expanded at any time.
Sector Classification
Stocks are mapped to the following ETFs:
XLK – Technology
XLF – Financials
XLV – Health Care
XLY – Consumer Discretionary
XLP – Consumer Staples
XLI – Industrials
XLE – Energy
XLU – Utilities
XLB – Materials
XLC – Communication Services
XLRE – Real Estate
For selected small-cap stocks where a sector classification adds limited value, an IWM (Russell 2000) designation may be used instead.
Why Use It for Day Trading?
Sector participation is often a major driver of intraday performance.
Examples:
A stock gapping up while its sector ETF is also strong has a higher probability of follow-through.
Multiple stocks from the same sector moving together can indicate institutional sector rotation.
Gap scanners frequently produce stocks from leading sectors. Knowing the sector immediately provides valuable context.
The indicator helps traders quickly answer:
Is this stock moving with its sector?
Is the sector leading or lagging the market?
Are multiple opportunities coming from the same industry group?
Why Use It for Swing Trading?
Swing traders often focus on stocks that are aligned with:
Sector strength
Market direction
Institutional money flow
A bullish setup in a strong sector generally has a higher probability than the same setup in a weak sector.
The Sector Tag allows traders to:
Compare stocks against their sector ETF
Monitor sector rotation
Build watchlists around leading sectors
Avoid concentration risk by unintentionally taking multiple positions within the same sector
Typical Workflow
Gap Scanner
Run a pre-market gap scan.
Open the stock chart.
Instantly see the sector ETF.
Compare the stock to its sector ETF.
Prioritize stocks showing both stock-specific and sector-wide strength.
Swing Trading
Identify technical setups.
Check sector alignment.
Favor setups in sectors already showing momentum.
Reduce exposure to sectors showing relative weakness.
Performance and Design
The indicator uses a compressed sector-mapping architecture optimized for TradingView Pine Script limitations.
Benefits:
Fast execution
Low resource usage
Large ticker coverage
Easy future expansion
No external data dependencies
Future Expansion
The ticker database is designed to be continuously updated.
Additional stocks, sectors, industry groups, or custom ETF mappings can be added without changing the core functionality of the indicator.
The goal is to provide a lightweight but highly practical tool that adds immediate market context to every chart.
Coverage
The current database contains approximately 1,300+ US-listed stocks, including:
S&P 500 constituents
Nasdaq 100 constituents
Russell 2000 constituents
Additional actively traded swing and day trading stocks
High-volume growth, momentum, and earnings candidates
The ticker database is manually curated and can be expanded at any time.
Sector Classification
Stocks are mapped to the following ETFs:
XLK – Technology
XLF – Financials
XLV – Health Care
XLY – Consumer Discretionary
XLP – Consumer Staples
XLI – Industrials
XLE – Energy
XLU – Utilities
XLB – Materials
XLC – Communication Services
XLRE – Real Estate
For selected small-cap stocks where a sector classification adds limited value, an IWM (Russell 2000) designation may be used instead.
Why Use It for Day Trading?
Sector participation is often a major driver of intraday performance.
Examples:
A stock gapping up while its sector ETF is also strong has a higher probability of follow-through.
Multiple stocks from the same sector moving together can indicate institutional sector rotation.
Gap scanners frequently produce stocks from leading sectors. Knowing the sector immediately provides valuable context.
The indicator helps traders quickly answer:
Is this stock moving with its sector?
Is the sector leading or lagging the market?
Are multiple opportunities coming from the same industry group?
Why Use It for Swing Trading?
Swing traders often focus on stocks that are aligned with:
Sector strength
Market direction
Institutional money flow
A bullish setup in a strong sector generally has a higher probability than the same setup in a weak sector.
The Sector Tag allows traders to:
Compare stocks against their sector ETF
Monitor sector rotation
Build watchlists around leading sectors
Avoid concentration risk by unintentionally taking multiple positions within the same sector
Typical Workflow
Gap Scanner
Run a pre-market gap scan.
Open the stock chart.
Instantly see the sector ETF.
Compare the stock to its sector ETF.
Prioritize stocks showing both stock-specific and sector-wide strength.
Swing Trading
Identify technical setups.
Check sector alignment.
Favor setups in sectors already showing momentum.
Reduce exposure to sectors showing relative weakness.
Performance and Design
The indicator uses a compressed sector-mapping architecture optimized for TradingView Pine Script limitations.
Benefits:
Fast execution
Low resource usage
Large ticker coverage
Easy future expansion
No external data dependencies
Future Expansion
The ticker database is designed to be continuously updated.
Additional stocks, sectors, industry groups, or custom ETF mappings can be added without changing the core functionality of the indicator.
The goal is to provide a lightweight but highly practical tool that adds immediate market context to every chart.
Notas de prensa
Update: Added support for major market, sector, and industry ETFs.The indicator now recognizes key benchmark ETFs (SPY, QQQ, IWM), all major sector ETFs (XLK, XLF, XLV, XLY, XLP, XLI, XLE, XLU, XLB, XLC, XLRE), and specialized industry ETFs such as SMH, XBI, KRE, TAN, XME, IGV, ITA, HACK, URA, and ARKK.
This enhancement improves sector and industry context for both day traders and swing traders, making it easier to track leadership, relative strength, and capital rotation across the market.
Notas de prensa
Tickers updatedScript de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.