OPEN-SOURCE SCRIPT
Zaktualizowano Relative Strength Table

Relative Strength Table
1. Overview and Key Features
The Relative Strength Table is an indicator that compares multiple tickers against a benchmark (default: SPY) and displays their relative strength.
It is designed to help analyze stock leadership, sector trends, and portfolio performance in one consolidated table.
You can freely input up to 20 tickers from the Inputs panel, allowing flexible comparisons.
(If 20 tickers feel too limited, let me know in the comments — I’ll expand it.)
2. How the RS Percentile Is Calculated and What It Means
The RS Percentile shows how strong the current price ratio is compared to past data, expressed as a percentile rank.
First, the indicator calculates the price ratio by dividing the ticker’s close by the benchmark’s close.
Then, it compares the latest ratio with historical ratio data and determines its percentile value.
Examples:
・80% or higher → relatively strong
・Around 50% → neutral
・40% or below → relatively weak
3. Indicator Features and Customization
3-1. RS Lookback Settings
You can set up to four lookback periods for RS calculation and customize the bar count for each.
Default values are 5, 21, 63, and 126 bars.
You can choose which column to sort by, and the selected column is marked with an asterisk.
Each RS column can be shown or hidden individually via checkboxes.
3-2. Visual Highlight Settings
Relative strength can be color-coded for clarity.
You can freely customize:
・Highlight colors
・Threshold values
・On/off toggles for each highlight layer
3-3. Default Tickers and Reset Function
These 16 sector ETFs are included as the default ticker set:
QQQ, QQQE, RSP, DIA, IWM, XLV, XLE, XLF, XLRE, XLB, XLP, XLU, XLY, XLK, XLC, XLI
You can return to the default list anytime by pressing the refresh button next to the ticker fields.
4. Use Cases and Analysis Examples
4-1. Sector Rotation Analysis
By comparing RS across multiple periods, you can easily identify:
・Sectors gaining short-term strength
・Sectors with steady long-term inflows
A sharp rise in short-term RS may signal the early stages of a rotation.
4-2. Identifying Leaders Within a Sector
You can compare up to 20 tickers at once, making it easy to spot true sector leaders.
4-3. Objective Evaluation of Portfolio Holdings
By entering your portfolio tickers, you can instantly see:
・Whether each name is outperforming or underperforming
・Which timeframes show strength
・How each ticker compares to the benchmark
1. Overview and Key Features
The Relative Strength Table is an indicator that compares multiple tickers against a benchmark (default: SPY) and displays their relative strength.
It is designed to help analyze stock leadership, sector trends, and portfolio performance in one consolidated table.
You can freely input up to 20 tickers from the Inputs panel, allowing flexible comparisons.
(If 20 tickers feel too limited, let me know in the comments — I’ll expand it.)
2. How the RS Percentile Is Calculated and What It Means
The RS Percentile shows how strong the current price ratio is compared to past data, expressed as a percentile rank.
First, the indicator calculates the price ratio by dividing the ticker’s close by the benchmark’s close.
Then, it compares the latest ratio with historical ratio data and determines its percentile value.
Examples:
・80% or higher → relatively strong
・Around 50% → neutral
・40% or below → relatively weak
3. Indicator Features and Customization
3-1. RS Lookback Settings
You can set up to four lookback periods for RS calculation and customize the bar count for each.
Default values are 5, 21, 63, and 126 bars.
You can choose which column to sort by, and the selected column is marked with an asterisk.
Each RS column can be shown or hidden individually via checkboxes.
3-2. Visual Highlight Settings
Relative strength can be color-coded for clarity.
You can freely customize:
・Highlight colors
・Threshold values
・On/off toggles for each highlight layer
3-3. Default Tickers and Reset Function
These 16 sector ETFs are included as the default ticker set:
QQQ, QQQE, RSP, DIA, IWM, XLV, XLE, XLF, XLRE, XLB, XLP, XLU, XLY, XLK, XLC, XLI
You can return to the default list anytime by pressing the refresh button next to the ticker fields.
4. Use Cases and Analysis Examples
4-1. Sector Rotation Analysis
By comparing RS across multiple periods, you can easily identify:
・Sectors gaining short-term strength
・Sectors with steady long-term inflows
A sharp rise in short-term RS may signal the early stages of a rotation.
4-2. Identifying Leaders Within a Sector
You can compare up to 20 tickers at once, making it easy to spot true sector leaders.
4-3. Objective Evaluation of Portfolio Holdings
By entering your portfolio tickers, you can instantly see:
・Whether each name is outperforming or underperforming
・Which timeframes show strength
・How each ticker compares to the benchmark
Informacje o Wersji
Updated to Pine Script version 6.Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.