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).
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.