Relative Strength vs SPY - real time & multi TF analysis
Dec 7, 2021

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.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

