OPEN-SOURCE SCRIPT
Relative Strength vs S&P 500 (SPX/ES)

Relative Strength vs S&P 500
This indicator measures the relative performance of an asset compared to the S&P 500, helping traders and investors identify whether an asset is outperforming or underperforming the broader market.
The calculation is based on a price ratio between the selected asset and the S&P 500, optionally normalized to a base value (100) for easier interpretation.
How to read it:
Above the baseline (100) → the asset is outperforming the S&P 500
Below the baseline (100) → the asset is underperforming the S&P 500
Rising line → strengthening relative performance
Falling line → weakening relative performance
Why it’s useful:
Helps focus on market leaders, not just assets that “look cheap”
Filters trades and investments in the direction of relative strength
Useful for swing trading, long-term investing, and portfolio allocation
Widely used in institutional and professional asset management
This indicator is best used as a trend and selection filter, in combination with technical setups (support/resistance, VWAP, structure).
This indicator measures the relative performance of an asset compared to the S&P 500, helping traders and investors identify whether an asset is outperforming or underperforming the broader market.
The calculation is based on a price ratio between the selected asset and the S&P 500, optionally normalized to a base value (100) for easier interpretation.
How to read it:
Above the baseline (100) → the asset is outperforming the S&P 500
Below the baseline (100) → the asset is underperforming the S&P 500
Rising line → strengthening relative performance
Falling line → weakening relative performance
Why it’s useful:
Helps focus on market leaders, not just assets that “look cheap”
Filters trades and investments in the direction of relative strength
Useful for swing trading, long-term investing, and portfolio allocation
Widely used in institutional and professional asset management
This indicator is best used as a trend and selection filter, in combination with technical setups (support/resistance, VWAP, structure).
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.