OPEN-SOURCE SCRIPT
업데이트됨 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
릴리즈 노트
Updated to Pine Script version 6.오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.