Stock Screener (‘RS Rating’) – Example 1: Identify symbols based on relative strength ratings in percentile terms

The RS Rating is a numerical score ranging from 1 to 99, with 99 indicating the strongest relative strength over the past 12 months, enabling investors to identify leading stocks with potential for continued outperformance in the market

4–6 minutes

This functionality, pertaining to Relative Strength Rating, will be introduced in January 2024.


RS Rating Scan Example #1: Identify symbols based on relative strength ratings in percentile terms

Set OptVar IndexNames = NIFTYLMID250, NIFTYSML250, NIFTYMIC250

[BEGIN RRC - IndexNames]

List symbols where
C > 100
and VOL > 25000
and TRADES > 1000
and (RSRATING(NIFTY) > 75 or RSRATINGST(NIFTY) > 80)

Add Column RSRATING(NIFTY) as RsRating
Sort on Column RsRating desc 'limit 25%
Add Column RSRATINGST(NIFTY) as RsRatingST
Add Column SECTOR

'Plot Template abc

Set date to "15-Dec-2023"

Apply to IndexNames

[END]

Purpose of the Scan

This scan aims to identify symbols within the NIFTYTOTAL Index by assessing their relative strength ratings.

The goal is to pinpoint a stock’s performance position within a group of reviewed stocks. The RS Rating, measured in percentile terms, provides insights into whether a stock falls within the lower 50% or top 10% of performers.

In pursuit of this objective, filtering functions linked to RS Rating are employed, and the approach involves ranking stocks in percentile terms daily to assess their performance in comparison to peers and a designated benchmark index within the stock portfolio.

Let’s go!



Line 1

Set OptVar IndexNames = NIFTYLMID250, NIFTYSML250, NIFTYMIC250

We’re creating an optimized variable named “IndexNames” using the “Set OptVar” function. This variable acts as a placeholder in both the scan heading and the scan itself. It will be replaced with three specific input values: “NIFTYLMID250”, “NIFTYLSML250”, and “NIFTYLMIC250”.

Feel free to choose any term for “IndexNames”, but ensure you replace it globally for the scan to function properly.


Line 2

[BEGIN RRC - IndexNames]

The optimized scan procedure starts with a “BEGIN” command.

Subsequently, the text “RRC – IndexNames” following the “BEGIN” command acts as the specific heading for the scan results presented in the report.


Lines 3 through 7

List symbols where
C > 100
and VOL > 25000
and TRADES > 1000
and (RSRATING(NIFTY) > 75 or RSRATINGST(NIFTY) > 80)

The first line (“List symbols where”) instructs the scanning code to display a compilation of stock symbols meeting specific criteria:

  1. Closing price > Rs.100 (“C > 100”)
  2. Daily traded volume > 25,000 (“VOL > 25000”)
  3. Number of daily trades > 1000 (“TRADES > 1000”)
  4. Satisfying either of the two conditions: RS Rating > 75 (“RSRATING(NIFTY) > 75”) or Short-term RS Rating > 80 (“RSRATINGST(NIFTY) > 80”)

The “RSRATING(NIFTY)” function computes the Relative Strength Rating for NIFTYTOTAL stocks, using NIFTY as the benchmark index. Simultaneously, the “RSRATINGST(NIFTY)” function computes the Short-term Relative Strength Rating for NIFTYTOTAL stocks, again based on NIFTY as the benchmark index.

The “and” function combines multiple conditions, while the “or” function in Line #7 facilitates an either/or scenario. This scan employs a nested “or” condition within a broader “and” condition.

Note: The filters provided are for illustration purposes. If you deem these filters unnecessary, you can execute the scan without these filters.


Lines 8 through 11

Add Column RSRATING(NIFTY) as RsRating 
Sort on Column RsRating desc 'limit 25%
Add Column RSRATINGST(NIFTY) as RsRatingST
Add Column SECTOR

Lines 8, 10 and 11 instruct the scan to generate three columns using the “Add Column” function:

  1. Include a column labeled “RsRating” to showcase the corresponding “RSRATING” values based on “(NIFTY)” as the benchmark index.
  2. Include another column labeled “RsRatingST” to display the associated “RSRATINGST” (short-term RS Rating) values based on “(NIFTY)” as the benchmark index.
  3. Introduce a column named “SECTOR” to display the sector of qualifying symbols.

The “Sort on Column” function arranges a column in either ascending or descending order. Specifically, the “RsRating” column will be arranged in descending order (“desc”). Enabling the disabled section (‘) of Line 9 will restrict the results to the top 25% symbols (“limit 25%”).

Feel free to customize these column titles according to your preferences.


Line 12

'Plot Template abc

The scan code line is deactivated or commented out, so it won’t be executed by the ChartAlert scanning engine.

However, the “Plot Template” feature improves your charting experience. It lets you easily apply a personalized template when you click on a symbol in the scan results report.

The suggested template in the scan code is named “abc”, but you can name it as you prefer and select any template from your collection.


To create a template within ChartAlert, you can emulate these instructions:

  1. Begin by opening any chart of your choice.
  2. Proceed to plot 50-bar and 200-bar moving averages on the Candlestick chart type.
  3. Then, add the RS-Ratio/ RS-Momentum indicators via an indicator panel.
  4. Also add the RS Rating indicator via another indicator panel.
  5. Finally, save this template as “RRC and RS Rating”, but remember that you are at liberty to select any name that aligns with your requirements.

These steps will ensure a seamless and personalized charting experience in ChartAlert.


Line 13

Set date to "15-Dec-2023"

The “Set date to” function instructs the scan code to execute based on the specified date, which must be entered within double quotes (“”) and in the dd-mmm-yyyy format.


Line 14

Apply to IndexNames

The “Apply to …” function scans the variable “IndexNames”.

This variable, “IndexNames”, is optimized to represent three main segments: “NIFTYLMID250”, “NIFTYLSML250”, and “NIFTYLMIC250”.

The NIFTYLMID250 Index combines Nifty and Nifty Next 50 (LargeCaps) with Nifty Midcap 150 (Midcaps).

The NIFTYSML250 Index includes 250 SmallCap stocks, while the NIFTYMIC250 Index comprises 250 MicroCap stocks.


Line 15

[END]

The optimized scan code concludes with an “END” statement.


The Scan Report in ChartAlert

Discover more from ChartAlert®

Subscribe now to keep reading and get access to the full archive.

Continue reading

Discover more from ChartAlert®

Subscribe now to keep reading and get access to the full archive.

Continue reading