OPEN-SOURCE SCRIPT

Sector RSI (Auto-Select)

53
This indicator measures the relative strength momentum of any stock against its most closely correlated sector ETF, using the Relative Strength Index (RSI).

Auto sector selection: The script computes correlations between your symbol’s short-term returns and all major SPDR sector ETFs (XLB, XLE, XLF, XLI, XLK, XLP, XLU, XLV, XLY, XTN). The sector with the highest correlation is automatically chosen as the benchmark.

Sector vs Symbol RSI: It calculates RSI (default 14-period) for both the chosen sector and the current chart’s symbol.

Display modes:

Line mode: Plots both RSIs with colored fill (red if the sector RSI is stronger, green if the symbol RSI is stronger).

Histogram mode: Shows the difference between Sector RSI and Symbol RSI as a column chart.

RSI bands: Standard 70/50/30 reference lines are available in line mode.

Status line: The selected sector’s ticker is shown on the TradingView status line so you always know which sector is being used.

Use Cases:

Identify whether a stock’s momentum is driven by its sector or if it’s showing independent relative strength.

Detect sector rotations: when the stock begins to outperform or underperform its sector on momentum basis.

Combine with absolute RSI levels (overbought/oversold) to filter signals.

Notes:

This tool infers sector membership via rolling correlation, not from static classification metadata. This means in some cases (e.g. diversified companies or news shocks) the “best” sector may not be the official one, but the one most correlated in the current market regime.

Use min positive correlation input to filter out weak matches and enforce a fallback (defaults to Technology XLK).

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.