PROTECTED SOURCE SCRIPT
Advanced RS Ranking & Peer Comparison

Advanced RS Rating & Sector Comparison
Original Concept & Logic by Dr. Chintan Joshi
Overview
This indicator is designed to help traders identify Market Leaders by quantifying Relative Strength (RS) on a standardized 1-99 scale. Unlike standard RSI (which looks at internal momentum), this RS Rating measures a stock's performance relative to a Benchmark (default: NIFTY 50) over a specific lookback period.
The tool goes a step further by comparing the stock's RS Rating against its Market Cap Index (e.g., Smallcap) and its Sector Index (e.g., CNX Metal, CNX IT) to determine if the stock is a "Leader" or a "Laggard" within its own category.
Key Features
RS Rating (0-99 Scale):
Calculates the ratio of the Stock Price vs. Benchmark (Nifty).
Normalizes this ratio over a lookback period (Default: 90 bars) to produce a score between 1 and 99.
A score of 90+ indicates the stock is in the top tier of relative performance against the benchmark.
Sector & Cap Comparison:
Auto-Sector Detection: The script automatically attempts to detect the sector of the current symbol (e.g., "Tata Motors" -> "CNXAUTO") and compares the stock's RS against the Sector Index's RS.
Market Cap Context: Compares the stock against a broader Market Cap index (Default: CNXSMALLCAP) to see if it is outperforming its capitalization peers.
Leader vs. Laggard Status:
The dashboard calculates the "Lead/Lag" spread.
Green (Leader): The stock's RS Rating is higher than the comparison index.
Red (Laggard): The stock's RS Rating is lower than the comparison index.
How to Use
Add to Chart: The indicator displays a compact table (movable and resizable).
Settings:
RS Lookback Length: Default is 90 (approx 1 quarter for daily charts). Adjust based on your trading style (e.g., 21 for short term, 250 for long term).
Benchmark: Set your base market index (Default: NSE:NIFTY).
Market Cap Index: Set the index relevant to your stock (e.g., NSE:CNXSMALLCAP or NSE:CNX500).
Sector Logic: Keep "Auto-Detect" on for NSE stocks. If the sector is not detected, you can manually define a sector ticker (e.g., NSE:CNXREALTY).
Visuals:
You can change the table size (Tiny to Huge) and position (e.g., Bottom Right) in the settings to fit your screen layout.
Interpreting the Dashboard
RS Rating: The raw strength score of the current symbol.
Lead/Lag: The points difference between the Stock's score and the Index's score.
Example: If Stock RS is 95 and Sector RS is 80, the Lead is +15.0.
Status: Text indication of "Leader" or "Laggard".
Credits:
This script and the underlying Relative Strength ranking logic are based on the concepts developed by Dr. Chintan Joshi.
Original Concept & Logic by Dr. Chintan Joshi
Overview
This indicator is designed to help traders identify Market Leaders by quantifying Relative Strength (RS) on a standardized 1-99 scale. Unlike standard RSI (which looks at internal momentum), this RS Rating measures a stock's performance relative to a Benchmark (default: NIFTY 50) over a specific lookback period.
The tool goes a step further by comparing the stock's RS Rating against its Market Cap Index (e.g., Smallcap) and its Sector Index (e.g., CNX Metal, CNX IT) to determine if the stock is a "Leader" or a "Laggard" within its own category.
Key Features
RS Rating (0-99 Scale):
Calculates the ratio of the Stock Price vs. Benchmark (Nifty).
Normalizes this ratio over a lookback period (Default: 90 bars) to produce a score between 1 and 99.
A score of 90+ indicates the stock is in the top tier of relative performance against the benchmark.
Sector & Cap Comparison:
Auto-Sector Detection: The script automatically attempts to detect the sector of the current symbol (e.g., "Tata Motors" -> "CNXAUTO") and compares the stock's RS against the Sector Index's RS.
Market Cap Context: Compares the stock against a broader Market Cap index (Default: CNXSMALLCAP) to see if it is outperforming its capitalization peers.
Leader vs. Laggard Status:
The dashboard calculates the "Lead/Lag" spread.
Green (Leader): The stock's RS Rating is higher than the comparison index.
Red (Laggard): The stock's RS Rating is lower than the comparison index.
How to Use
Add to Chart: The indicator displays a compact table (movable and resizable).
Settings:
RS Lookback Length: Default is 90 (approx 1 quarter for daily charts). Adjust based on your trading style (e.g., 21 for short term, 250 for long term).
Benchmark: Set your base market index (Default: NSE:NIFTY).
Market Cap Index: Set the index relevant to your stock (e.g., NSE:CNXSMALLCAP or NSE:CNX500).
Sector Logic: Keep "Auto-Detect" on for NSE stocks. If the sector is not detected, you can manually define a sector ticker (e.g., NSE:CNXREALTY).
Visuals:
You can change the table size (Tiny to Huge) and position (e.g., Bottom Right) in the settings to fit your screen layout.
Interpreting the Dashboard
RS Rating: The raw strength score of the current symbol.
Lead/Lag: The points difference between the Stock's score and the Index's score.
Example: If Stock RS is 95 and Sector RS is 80, the Lead is +15.0.
Status: Text indication of "Leader" or "Laggard".
Credits:
This script and the underlying Relative Strength ranking logic are based on the concepts developed by Dr. Chintan Joshi.
Скрипт с защищённым кодом
Этот скрипт опубликован с закрытым исходным кодом. Однако вы можете использовать его свободно и без каких-либо ограничений — читайте подробнее здесь.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с защищённым кодом
Этот скрипт опубликован с закрытым исходным кодом. Однако вы можете использовать его свободно и без каких-либо ограничений — читайте подробнее здесь.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.