OPEN-SOURCE SCRIPT
Stock Sector ETF with Indicators

The Stock Sector ETF with Indicators is a versatile tool designed to track the performance of sector-specific ETFs relative to the current asset. It automatically identifies the sector of the underlying symbol and displays the corresponding ETF’s price action alongside key technical indicators. This helps traders analyze sector trends and correlations in real time.
---
Key Features
Automatic Sector Detection:
Technical Indicators:
Customizable Inputs:
Informative Table:
---
Input Settings
SMA Settings
Bollinger Bands Settings
Donchian High (52-Week High)
Sector Selections
---
Example Use Cases
---
Key Features
Automatic Sector Detection:
- Fetches the sector of the current asset (e.g., "Technology" for AAPL).
- Maps the sector to a user-defined ETF (default: SPDR sector ETFs)[using close prices].
Technical Indicators:
- Simple Moving Average (SMA): Tracks the ETF’s trend.
- Bollinger Bands: Highlights volatility and potential reversals.
- Donchian High (52-Week High): Identifies long-term resistance levels.
Customizable Inputs:
- Adjust indicator parameters (length, visibility).
- Override default ETFs for specific sectors.
Informative Table:
- Displays the current sector and ETF symbol in the bottom-right corner.
---
Input Settings
SMA Settings
- SMA Length: Period for calculating the Simple Moving Average (default: 200).
- Show SMA: Toggle visibility of the SMA line.
Bollinger Bands Settings
- BB Length: Period for Bollinger Bands calculation (default: 20).
- BB Multiplier: Standard deviation multiplier (default: 2.0).
- Show Bollinger Bands: Toggle visibility of the bands.
Donchian High (52-Week High)
- Daily High Length: Days used to calculate the high (default: 252, approx. 1 year).
- Show High: Toggle visibility of the 52-week high line.
Sector Selections
- Customize ETFs for each sector (e.g., replace XLU with another utilities ETF).
---
Example Use Cases
- Trend Analysis: Compare a stock’s price action to its sector ETF’s SMA for trend confirmation.
- Volatility Signals: Use Bollinger Bands to spot ETF price squeezes or breakouts.
- Sector Strength: Monitor if the ETF is approaching its 52-week high to gauge sector momentum.
Enjoy tracking sector trends with ease! 🚀
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.