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. Подробнее читайте в Условиях использования.