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!
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.