OPEN-SOURCE SCRIPT
Relative Strength Matrix

Overview
This script is based on work of jfsrev 's indicator "Swing Data - ADR% / RVol / PVol / Float % / Avg $ Vol", which I modified heavily and left only the Relative Strength related calculations and added to these.
The Relative Strength Matrix is a contextual dashboard designed to help traders instantly identify whether a stock—and its corresponding industry or sector—is displaying true leadership or relative weakness. By tracking rolling price performance across multiple timeframes relative to the S&P 500 (SPX), the script visualizes market alpha directly on your chart via a clean, dynamic, and non-intrusive matrix panel.
Features and customization
Script has following main features and customization options:
Order for RS calculation
Relative Strength is checked and mapped in the following order:
This script is based on work of jfsrev 's indicator "Swing Data - ADR% / RVol / PVol / Float % / Avg $ Vol", which I modified heavily and left only the Relative Strength related calculations and added to these.
The Relative Strength Matrix is a contextual dashboard designed to help traders instantly identify whether a stock—and its corresponding industry or sector—is displaying true leadership or relative weakness. By tracking rolling price performance across multiple timeframes relative to the S&P 500 (SPX), the script visualizes market alpha directly on your chart via a clean, dynamic, and non-intrusive matrix panel.
Features and customization
Script has following main features and customization options:
- Modifiable RS score calculation: you can dynamically adjust the mathematical percentage weights for the 2-Week (10d), 1-Month (21d), 3-Month (63d), and 6-Month (126d) momentum lookback periods straight from the UI settings.
- Multi-Period Trend Tracking: Calculates and presents the real-time absolute percentage performance of the tracked industry ETF over different time periods. Results can be shown or hidden for each calculation separately.
- Individual tickers can be mapped to target ETFs: You can form your own groups with individual tickers and specify benchmark ETF for them (e.g. Tickers: CRWD, S, PANW => Target industry: CIBR)
- Industry specific mapping to target ETF: You can use TradingViews provided Industry-information and map the industry to specific ETF (e.g., TW Industry: Semiconductors => Target ETF: SMH)
- Complete UI visuals customization: You can customize table position, sizes, background transparencies, border widths, and text colors.
Order for RS calculation
Relative Strength is checked and mapped in the following order:
- Tier 1: Custom Groups (Fully User-Defined) - The script checks if the current ticker belongs to any of your 20 fully customizable thematic watchlists (e.g., Cybersecurity, Semis, Crypto Infrastructure). If found, it instantly binds the stock to your manually assigned thematic ETF.
- Tier 2: Core Industries (User-Defined Mappings) – If not found in a custom group, the script screens the stock's native TradingView Industry against 30 available custom mapping slots to find your preferred benchmark tracking ETF.
- Tier 3: Sector Fallback (Hardcoded) – If no custom group or industry mapping exists, the engine relies on a robust, hardcoded fallback architecture that maps the stock’s native TradingView Sector to its corresponding Select Sector SPDR ETF (e.g., Electronic Technology is mapped to XLK, Finance is mapped to XLF, Energy is mapped to XLE etc).
- Tier 4: Global Catch-All – If a stock does not belong to any defined industry or sector, it defaults to SPY to guarantee a clean baseline calculation without script errors.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.