OPEN-SOURCE SCRIPT

Stock vs SPY % Change

144
Stock vs SPY % Change Indicator

This Pine Script indicator helps you compare a stock's price performance to the S&P 500 (using SPY ETF) over a user-defined period. It calculates the percentage price change of the stock and SPY, then displays the difference as a relative performance metric. A positive value (plotted in green) indicates the stock is outperforming SPY (e.g., dropping only 3% while SPY drops 10%), while a negative value (plotted in red) shows underperformance.

Features:
Adjustable lookback period (default: 20 days) to analyze recent performance.
Visual plot with green/red coloring for quick interpretation.
Zero line to clearly separate outperformance from underperformance.

How to Use:
Apply the indicator to your stock's chart.
Set the "Lookback Period" in the settings (e.g., 20 for ~1 month).
Check the plot:
Green (above 0) = Stock's % change is better than SPY's.
Red (below 0) = Stock's % change is worse than SPY's.

Use on daily or weekly charts for best results.

Ideal for identifying stocks that hold up better during market downturns or outperform in uptrends. Perfect for relative strength analysis and to spot accumulation.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.