All indicators

Relative Strength of a stock

Jul 16, 2020

Static chart image
Price Action BasedSignalsCorrelationMoving Averages

The Relative Strength of a stock indicator provides a comparative analysis of an asset's performance against a major benchmark index to identify market outperformance or underperformance. By calculating the ratio of price changes between the asset and a reference symbol, this tool helps traders isolate stocks that are exhibiting independent strength regardless of broader market direction.

Usage

The Usage section focuses on identifying trend shifts and momentum relative to a selected benchmark. Traders typically use this indicator to find assets that are trending upward while the benchmark remains flat or declining.

  • Zero Line Crossovers: When the Relative Strength (RS) line crosses above the zero line, it indicates the asset has outperformed the benchmark over the specified period. Conversely, a cross below zero suggests underperformance.
  • Trend Confirmation: The RS Trend setting changes the color of the zero line based on the slope of the RS line, helping to identify if the relative momentum is accelerating or decelerating.
  • Moving Average Integration: Users can enable a moving average on the RS line to smooth out fluctuations and identify long-term shifts in relative strength.
  • Price Confirmation Bubbles: These visual cues appear on the RS line when the asset price is trading above its own Simple Moving Average (SMA), providing a confluence of absolute and relative strength.

Details

The script calculates relative strength by taking the ratio of the current symbol's percentage change over a specific period and dividing it by the benchmark symbol's percentage change over that same period. The result is then normalized around a zero baseline.

Unlike the Relative Strength Index (RSI), which measures internal momentum, this indicator focuses on "Comparative Relative Strength." The implementation includes a lookback reference label that identifies the exact starting point of the calculation on the chart. It also utilizes trigonometric functions to calculate the angle of the RS trend, allowing for a color-coded zero line that reflects the rate of change in outperformance.

Settings

General Settings

  • Source: The price source used for calculations (default is Close).
  • Comparative Symbol: The benchmark ticker to compare the asset against (e.g., NSE:NIFTY, SPX, BTCUSD).
  • Period: The lookback length used to calculate the percentage change for both the asset and the benchmark.
  • Show Zero Line: Toggles the visibility of the central reference line.
  • Show Reference Label: Displays a label on the chart marking the start date of the RS period.
  • Toggle RS Color on Crossovers: Changes the RS line color based on whether it is above (green) or below (red) the zero line.

RS Trend

  • RS Trend: Enables color-coding of the zero line based on the slope of the relative strength.
  • Range: The lookback period used to calculate the slope/angle of the RS trend.

RS Mean

  • Show MA: Displays a Simple Moving Average (SMA) of the Relative Strength line.
  • Period: Sets the length of the RS Moving Average.
  • Trend Color: When enabled, the MA changes color based on whether it is rising or falling.

Price Confirmation

  • Show Bubbles: Toggles circular highlights on the RS line when price trend conditions are met.
  • Period: The SMA length used to determine the asset's absolute trend.
  • +ve / -ve: Customizable colors for bullish and bearish price confirmation signals.

FAQ

How do I interpret a rising RS line when the benchmark is falling? A rising RS line during a market downtrend indicates that the asset is falling less than the benchmark or is moving counter to the market, which is a strong sign of defensive strength or institutional accumulation.

Can I use this for assets other than stocks? Yes, the indicator can compare any two instruments, such as comparing Altcoins to Bitcoin or individual commodities to a commodity index.

How do I access the Relative Strength of a stock indicator? 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.