OPEN-SOURCE SCRIPT
Relative Strength vs. Benchmark (相對強度)

This "Relative Strength vs. Benchmark" indicator helps you see a stock's true performance against a benchmark (like the S&P 500) at a glance. By calculating the price ratio between the two, it strips away the overall market noise, allowing you to focus on identifying true market leaders and underperforming laggards.
How It Works
Core Formula: Relative Strength = Stock Price / Benchmark Index Price
A Rising Line: Means the stock is outperforming the benchmark.
A Falling Line: Means the stock is underperforming the benchmark.
The indicator also includes a Moving Average (MA) of the Relative Strength line itself. This MA helps to confirm the trend of relative strength and filter out short-term noise.
How to Use
Find Market Leaders: When the market is in an uptrend or consolidating, look for stocks whose RS line is breaking out to new highs.
Avoid Laggards: If the RS line is consistently below its moving average or making new lows, the stock is significantly underperforming the market and should be treated with caution.
Trend Change Signals: A cross of the RS line above its MA can be seen as a signal that a new trend of relative outperformance is beginning. A cross below suggests the trend is weakening.
Features & Settings
Customizable Benchmark: You can change the default benchmark from TWSE:TSE to any symbol you need, such as SP:SPX for the S&P 500 or NASDAQ:NDX for the Nasdaq 100.
Adjustable MA Length: Customize the period for the RS Moving Average to fit your trading style (short-term or long-term).
Visual Toggle: Easily turn the colored background fill on or off according to your preference.
Hope you find this tool helpful in your analysis!
How It Works
Core Formula: Relative Strength = Stock Price / Benchmark Index Price
A Rising Line: Means the stock is outperforming the benchmark.
A Falling Line: Means the stock is underperforming the benchmark.
The indicator also includes a Moving Average (MA) of the Relative Strength line itself. This MA helps to confirm the trend of relative strength and filter out short-term noise.
How to Use
Find Market Leaders: When the market is in an uptrend or consolidating, look for stocks whose RS line is breaking out to new highs.
Avoid Laggards: If the RS line is consistently below its moving average or making new lows, the stock is significantly underperforming the market and should be treated with caution.
Trend Change Signals: A cross of the RS line above its MA can be seen as a signal that a new trend of relative outperformance is beginning. A cross below suggests the trend is weakening.
Features & Settings
Customizable Benchmark: You can change the default benchmark from TWSE:TSE to any symbol you need, such as SP:SPX for the S&P 500 or NASDAQ:NDX for the Nasdaq 100.
Adjustable MA Length: Customize the period for the RS Moving Average to fit your trading style (short-term or long-term).
Visual Toggle: Easily turn the colored background fill on or off according to your preference.
Hope you find this tool helpful in your analysis!
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.