OPEN-SOURCE SCRIPT

Sector SPDR ETFs

27
This script automatically identifies the SPDR sector ETF that corresponds to the currently viewed US stock ticker. It maps over 500 US-listed stocks to their respective SPDR sector ETFs — such as XLK (Technology), XLF (Financials), XLY (Consumer Discretionary), and others — based on pre-defined symbol lists.

When applied to a chart, the script displays a label below the last candle showing the SPDR sector symbol (e.g., "XLE" for Energy stocks like XOM). This allows traders and investors to quickly understand the sector classification of any stock they analyze.

Key Features:

  • Maps tickers to SPDR sector ETFs: XLC, XLY, XLP, XLE, XLF, XLV, XLI, XLB, XLRE, XLK, and XLU.
  • Displays the corresponding sector label on the chart.
  • Helpful for sector rotation strategies, macro analysis, or thematic investing.


Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.