OPEN-SOURCE SCRIPT
NBSG_RelativeStrength_Labels

OVERVIEW
The Relative Strength (RS) Rolling Labels is a minimalist, high-utility analysis tool that provides an at-a-glance comparison of an asset’s performance against a primary market benchmark (default: CBOE: SPX). While many traders use fixed calendar months for relative strength, this indicator utilizes Rolling Trading-Day Windows (21, 63, and 126 sessions). This ensures that your momentum data is always current and consistent, regardless of the day of the month, providing a superior signal for active day and swing traders.
KEY FEATURES
Rolling Lookbacks: Uses 21D (1M), 63D (3M), and 126D (6M) trading-day periods for a consistent rate-of-change calculation.Institutional Benchmark: Locked to CBOE: SPX by default for high-fidelity index tracking.Dynamic UI: A clean, minimalist table that stays pinned to your chart corner, providing critical data without cluttering your price action.Conditional Coloring: Instantly identify outperformance (Green) or underperformance (Red) relative to the broader market.
CALCULATION LOGIC
Relative Strength is calculated by determining the percentage return of the chart's current asset and subtracting the percentage return of the benchmark over the same rolling period:$
RS = (\text{Asset Return} \%) - (\text{Benchmark Return} \%)$$A positive value indicates the asset is "winning" against the index, while a negative value indicates it is lagging.
USAGE
This script is best used on a Daily (D) timeframe for maximum precision, though it is programmed to pull Daily data regardless of your active chart timeframe. It is a vital tool for traders looking to "buy strength and sell weakness" by identifying assets that are holding up or leading when the broader market is under pressure.
DISCLAIMER
This script is an informational tool and does not constitute financial advice. Always use proper risk management and size your positions according to your individual trading plan.
The Relative Strength (RS) Rolling Labels is a minimalist, high-utility analysis tool that provides an at-a-glance comparison of an asset’s performance against a primary market benchmark (default: CBOE: SPX). While many traders use fixed calendar months for relative strength, this indicator utilizes Rolling Trading-Day Windows (21, 63, and 126 sessions). This ensures that your momentum data is always current and consistent, regardless of the day of the month, providing a superior signal for active day and swing traders.
KEY FEATURES
Rolling Lookbacks: Uses 21D (1M), 63D (3M), and 126D (6M) trading-day periods for a consistent rate-of-change calculation.Institutional Benchmark: Locked to CBOE: SPX by default for high-fidelity index tracking.Dynamic UI: A clean, minimalist table that stays pinned to your chart corner, providing critical data without cluttering your price action.Conditional Coloring: Instantly identify outperformance (Green) or underperformance (Red) relative to the broader market.
CALCULATION LOGIC
Relative Strength is calculated by determining the percentage return of the chart's current asset and subtracting the percentage return of the benchmark over the same rolling period:$
USAGE
This script is best used on a Daily (D) timeframe for maximum precision, though it is programmed to pull Daily data regardless of your active chart timeframe. It is a vital tool for traders looking to "buy strength and sell weakness" by identifying assets that are holding up or leading when the broader market is under pressure.
DISCLAIMER
This script is an informational tool and does not constitute financial advice. Always use proper risk management and size your positions according to your individual trading plan.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.