All indicators

Relative Strength vs SPY - real time & multi TF analysis

Dec 7, 2021

Static chart image
Dashboard

The Relative Strength vs SPY - real time & multi TF analysis indicator provides a comprehensive dashboard for monitoring the relative performance of up to 39 symbols against a benchmark (such as SPY) across multiple timeframes.

Usage

The tool is designed to help traders identify outperforming and underperforming assets at a glance. By calculating the percentage change of a stock relative to the percentage change of a benchmark over a specified period, the indicator highlights symbols exhibiting relative strength (green) or weakness (red).

A highly effective way to use this indicator is to apply three separate instances to your chart:

  • Instance 1: Set the table position to "Left" and choose a short timeframe (e.g., 5-minute).
  • Instance 2: Set the table position to "Center" and choose an intermediate timeframe (e.g., 4-hour).
  • Instance 3: Set the table position to "Right" and choose a long timeframe (e.g., Daily).

This configuration allows you to verify if an intraday move aligns with broader trend relative strength. To maximize clarity, it is recommended to disable other visual chart elements and use a dedicated side-window for these tables.

Details

The script uses the request.security() function to fetch data for 39 customizable symbols and a benchmark symbol simultaneously. The Relative Strength (RS) is calculated by taking the difference between the percentage change of the target symbol and the percentage change of the benchmark over a defined length (defaulting to 10 periods).

The implementation is based on a modular screener template, updated to support modern Pine Script features and visual readability. It allows for real-time updates of market data and RS values within the dashboard.

Settings

Calculation inputs

  • Comparison Symbol: The benchmark ticker used for comparison (e.g., SPY, QQQ, BTCUSD).
  • Relative Strength Timeframe: The specific timeframe used for the RS calculations within the current table instance.
  • RS calculation period length: The number of bars used to calculate the percentage change for both the benchmark and the symbols.

Table display settings

  • Position of table: Determines where the table is rendered on the chart (Left, Center, or Right).
  • Display ticker symbol and price: Toggles whether the ticker name and its current price are visible in the table.

Stock selection

  • Symbols 1-39: Toggle checkboxes and input fields to define which symbols are tracked in the screener.

FAQ

How do I change the list of stocks in the table?

You can update the symbols in the "Stock selection" section of the settings menu. To avoid repeating this process, it is recommended to save your configuration as a Chart Template.

Can I compare stocks against something other than SPY?

Yes, you can change the "Comparison Symbol" in the settings to any valid ticker, such as QQQ for tech stocks or BTC for crypto markets.

How can I access the Relative Strength vs SPY - real time & multi TF analysis?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.