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.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。