RRC Stock Screener – Example 15: Rank symbols based on relative strength and momentum and group them by their RRC quadrants (“RRC Rank”) (“RRC Grid”) (“Quadrants”)

The RRC Rank uses RS Ratio and RS Momentum indicators to assess a stock’s relative strength against a benchmark index; the RS Rating, a numerical percentile score over the last 12 months, helps investors identify top-performing stocks with 99 indicating the highest relative strength, enabling consistent market outperformance

10 minutes

This functionality, pertaining to Relative Rotational Charts (RRC), was enhanced in January 2024.


RRC Scan Example #15: Identify symbols based on “RS Rating” and also rank them based on RS Ratio and RS Momentum (“RRC Rank”)

Set OptVar IndexNames = NIFTYLMID250, NIFTYSML250, NIFTYMIC250

[BEGIN RRC - IndexNames - Q2 LEADERS]

List symbols where RSRATIO > 0 and RSMOMENTUM > 0

Add Column RSRATIO as RSRAT format 0.0000
Add Column RSMOMENTUM as RSMOM format 0.0000
Add Column RRCRANK
Sort on Column RRCRANK
Add Column SECTOR

'Plot Template abc

Set date to "15-Dec-2023"

Apply to IndexNames

[END]


[BEGIN RRC - IndexNames - Q3 WEAKENING]
List symbols where RSRATIO > 0 and RSMOMENTUM < 0
Add Column RSRATIO as RSRAT format 0.0000
Add Column RSMOMENTUM as RSMOM format 0.0000
Add Column RRCRANK
Sort on Column RRCRANK
Add Column SECTOR
'Plot Template abc
Set date to "15-Dec-2023"
Apply to IndexNames
[END]


[BEGIN RRC - IndexNames - Q4 LAGGARDS]
List symbols where RSRATIO < 0 and RSMOMENTUM < 0
Add Column RSRATIO as RSRAT format 0.0000
Add Column RSMOMENTUM as RSMOM format 0.0000
Add Column RRCRANK
Sort on Column RRCRANK
Add Column SECTOR
'Plot Template abc
Set date to "15-Dec-2023"
Apply to IndexNames
[END]


[BEGIN RRC - IndexNames - Q1 IMPROVING]
List symbols where RSRATIO < 0 and RSMOMENTUM > 0
Add Column RSRATIO as RSRAT format 0.0000
Add Column RSMOMENTUM as RSMOM format 0.0000
Add Column RRCRANK
Sort on Column RRCRANK
Add Column SECTOR
'Plot Template abc
Set date to "15-Dec-2023"
Apply to IndexNames
[END]

Purpose of the Scan

This scan aims to assess the relative strength and momentum of symbols within the NIFTYTOTAL Index compared to a benchmark index.

The goal is to categorize these symbols into the four quadrants of Relative Rotational Charts (RRC) based on their current positioning.

Leveraging the inherent capabilities of the RRC feature’s raw input functions, such as the RS Ratio and RS Momentum indicators, this scan code establishes the quadrant positioning and comprehensive RRC Rank for every symbol.

Let’s go!



Line 1

Set OptVar IndexNames = NIFTYLMID250, NIFTYSML250, NIFTYMIC250

Set OptVar IndexNames = NIFTYLMID250, NIFTYSML250, NIFTYMIC250

We are optimizing a factor named “IndexNames” using the “Set OptVar” function. This factor or variable acts as a stand-in in both the scan heading and the scan itself, to be replaced with three particular input values: “NIFTYLMID250”, “NIFTYLSML250”, and “NIFTYLMIC250”.

Feel free to choose an alternative term for “IndexNames,” but ensure a global replacement to guarantee the proper functioning of the scan.


Line 2 — First Block

[BEGIN RRC - IndexNames - Q2 LEADERS]

The optimized scanning process starts with the “BEGIN” command in this first block or section.

Following this, the phrase “RRC – IndexNames – Q2 LEADERS” after “BEGIN” becomes the precise title for the scan findings in the report.


Line 3
Q2 or Quadrant 2 — ‘Leaders’

List symbols where RSRATIO > 0 and RSMOMENTUM > 0

This command (“List symbols where”) prompts the scanning code to display a list of stock symbols based on specific criteria:

  1. Ensure that the RSRATIO is greater than 0 (“RSRATIO > 0”)
  2. Confirm that RSMOMENTUM surpasses 0 (“RSMOMENTUM > 0”)

This command prompt (“RSRATIO > 0” “and” “RSMOMENTUM > 0”) shows stocks in Quadrant 2, indicating they are “leaders” in relative strength. The “and” function is used to combine multiple conditions.


Lines 4 through 8

Add Column RSRATIO as RSRAT format 0.0000
Add Column RSMOMENTUM as RSMOM format 0.0000
Add Column RRCRANK
Sort on Column RRCRANK
Add Column SECTOR

Use the “Add Column” function to generate four columns with the following labels:

  1. Label the first column as “RSRAT” to exhibit corresponding “RSRATIO” values.
  2. Create a column named “RSMOM” to display associated “RSMOMENTUM” values.
  3. Introduce another column labeled “RRCRank” to signify the status of “RRCRANK”.
  4. Create a column titled “SECTOR” to indicate the sector of qualifying symbols.

Apply the “format 0.0000” function to display values with up to four decimals.

Customize column titles according to your preferences.


Line 9

'Plot Template abc

The scan code line is turned off in the ChartAlert scanning engine, meaning it won’t run.

However, the “Plot Template” feature improves your charting experience. It enables you to swiftly apply a personalized template by clicking on a symbol in the scan results report.

The default template in the scan code is labeled “abc”, but you have the flexibility to rename it 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 10

Set date to "15-Dec-2023"

The “Set date to” function directs the scan code to operate on a particular date. Input the date in double quotes (“”) using the dd-mmm-yyyy format.


Line 11

Apply to IndexNames

The “Apply to …” feature examines the “IndexNames” variable, representing three main groups: “NIFTYLMID250”, “NIFTYSML250” and “NIFTYMIC250”.

NIFTYLMID250 includes Nifty, Nifty Next 50 (LargeCaps), and Nifty Midcap 150 (Midcaps).

NIFTYSML250 comprises 250 SmallCap stocks, and NIFTYMIC250 includes 250 MicroCap stocks.


Line 12

[END]

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


Lines 13 through 23 — Second Block
Q3 or Quadrant 3 — ‘Weakening’

[BEGIN RRC - IndexNames - Q3 WEAKENING]
List symbols where RSRATIO > 0 and RSMOMENTUM < 0
Add Column RSRATIO as RSRAT format 0.0000
Add Column RSMOMENTUM as RSMOM format 0.0000
Add Column RRCRANK
Sort on Column RRCRANK
Add Column SECTOR
'Plot Template abc
Set date to "15-Dec-2023"
Apply to IndexNames
[END]

The only difference between this second block of scan code and the first block/section is Line #2.

The command line (“List symbols where”) prompts the scanning code to display a list of stock symbols based on specific criteria:

  1. Ensure that the RSRATIO is greater than 0 (“RSRATIO > 0”)
  2. Confirm that RSMOMENTUM is below 0 (“RSMOMENTUM < 0”)

This scan code line (“RSRATIO > 0” “and” “RSMOMENTUM < 0”) shows stocks in Quadrant 3, indicating they are “outperformers but with weakening momentum” in relative strength.


Lines 24 through 34 — Third Block
Q4 or Quadrant 4 — ‘Laggards’

[BEGIN RRC - IndexNames - Q4 LAGGARDS]
List symbols where RSRATIO < 0 and RSMOMENTUM < 0
Add Column RSRATIO as RSRAT format 0.0000
Add Column RSMOMENTUM as RSMOM format 0.0000
Add Column RRCRANK
Sort on Column RRCRANK
Add Column SECTOR
'Plot Template abc
Set date to "15-Dec-2023"
Apply to IndexNames
[END]

The only difference between this third block of scan code and the first block/section or the second block/section is Line #2.

The command line (“List symbols where”) prompts the scanning code to display a list of stock symbols based on specific criteria:

  1. Ensure that the RSRATIO is below 0 (“RSRATIO < 0”)
  2. Confirm that RSMOMENTUM is also below 0 (“RSMOMENTUM < 0”)

This scan code line (“RSRATIO < 0” “and” “RSMOMENTUM < 0”) shows stocks in Quadrant 4, indicating they are “laggards”, that is, underperformers with weak momentum in terms of relative strength.


Lines 35 through 45 — Fourth Block
Q1 or Quadrant 1 — ‘Improving’

[BEGIN RRC - IndexNames - Q1 IMPROVING]
List symbols where RSRATIO < 0 and RSMOMENTUM > 0
Add Column RSRATIO as RSRAT format 0.0000
Add Column RSMOMENTUM as RSMOM format 0.0000
Add Column RRCRANK
Sort on Column RRCRANK
Add Column SECTOR
'Plot Template abc
Set date to "15-Dec-2023"
Apply to IndexNames
[END]

The only difference between this fourth and last block of scan code and the first block or second block or third block/section is Line #2.

The command line (“List symbols where”) prompts the scanning code to display a list of stock symbols based on specific criteria:

  1. Ensure that the RSRATIO is below 0 (“RSRATIO < 0”)
  2. Confirm that RSMOMENTUM is greater than 0 (“RSMOMENTUM > 0”)

This scan code line (“RSRATIO < 0” “and” “RSMOMENTUM > 0”) shows stocks in Quadrant 1, indicating they are “underperformers with improving momentum” in terms of relative strength.


The Scan Report in ChartAlert


Introduce a variation to incorporate RS Ratings into this scan

Add Column RSRATING(NIFTY) as RsRating
Sort on Column RsRating desc
Add Column RSRATINGST(NIFTY) as RsRatingST

Integrate the provided code block into each of the four scan code blocks above to retrieve RS Ratings.

Use the following instructions to instruct the scan code to create three additional columns through the “Add Column” function:

1. Include a column named “RsRating” to present the corresponding “RSRATING” values, benchmarked against “(NIFTY)”.
2. Include another column named “RsRatingST” to exhibit the associated “RSRATINGST” (short-term RS Rating) values, benchmarked against “(NIFTY)”.

Employ the “Sort on Column” function to organize the “RsRating” column either in ascending or descending order. Specifically, arrange the “RsRating” column in descending order (“desc”).

Feel free to personalize these column titles based on your preferences.

Discover more from ChartAlert®

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

Continue reading