Editors' picks
OPEN-SOURCE SCRIPT

Industry Group Strength

Updated
The Industry Group Strength indicator is designed to help traders identify the best-performing stocks within specific industry groups. The movement of individual stocks is often closely tied to the overall performance of their industry. By focusing on industry groups, this indicator allows you to find the top-performing stocks within an industry.

Thanks to a recent Pine Script update, an indicator like this is now possible. Special thanks to PineCoders for introducing the dynamic requests feature.

How this indicator works:
The indicator contains predefined lists of stocks for each industry group. To be included in these lists, stocks must meet the following basic filters:

  • Market capitalization over 2B
  • Price greater than $10
  • Primary listing status


Once the relevant stocks are filtered, the indicator automatically recognizes the industry group of the current stock displayed on the chart. It then retrieves and displays data for that entire industry group.

Data Points Available:
The user can choose between three different data points to rank and compare stocks:

  • YTD (Year-To-Date) Return: Measures how much a stock has gained or lost since the start of the year.
  • RS Rating: A relative strength rating for a user-selected lookback period (explained below).
  • % Return: The percentage return over a user-selected lookback period.


Stock Ranking:
Stocks are ranked based on their performance within their respective industry groups, allowing users to easily identify which stocks are leading or lagging behind others in the same sector.

Visualization:
The indicator presents stocks in a table format, with performance metrics displayed both as text labels and color-coded lines. The color gradient represents the percentile rank, making it visually clear which stocks are outperforming or underperforming within their industry group.

Relative Strength (RS):
Relative Strength (RS) measures a stock’s performance relative to a benchmark, typically the S&P 500 (the default setting). It is calculated by dividing the closing price of the stock by the closing price of the S&P 500.

If the stock rises while the S&P 500 falls, or if the stock rises more sharply than the S&P 500, the RS value increases. Conversely, if the stock falls while the S&P 500 rises, the RS value decreases. This indicator normalizes the RS value into a range from 1 to 99, allowing for easier comparison across different stocks, regardless of their raw performance. This normalized RS value helps traders quickly assess how a stock is performing relative to others.

Release Notes
update to label count
Release Notes
Added data label next to industry group name. Fixed typo.
Release Notes
Added the option for compact mode. This will show the industry group along with top tickers and their selected data. The data display can be turned off as well to only show top tickers.

snapshot
Breadth IndicatorsPortfolio managementTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Trusted Pine programmer. Send me a message for script development.
Also on:

Disclaimer