I am publising Relative Strength Comparative.
It is be used to compare a Stock's Performance against another stock/index (Default NIFTY50)
I also devised a Plot RS Rating which is inspired from IBD's RS Rating and matches to some extent. You can turn off/on the RS Rating as per need.
Example: ITC vs NIFTY 50 it will be ITC / NIFTY

The Indicator can be used in Multiple ways:
1) Check Relative Strength
2) Check RS Rating (This is not Accurate as of now since IBD compares the ratings of all the stocks in an Exchange)
3) Can be used as a Spread Chart for the Division (We need to not divide every time we change Stocks)
4) Design a Template exactly as MarketSmith by using the TradingView feature of "Move to --> Existing Pane Above"

The Formula i used for RS Rating is below with more weightage on the 3 month performance and lesser on 12 month Performance. I am open to Modification of this Formula if a better suggestion

// relative strength IBD style
ThreeMthRS = 0.4*(close/close)
SixMthRS = 0.2*(close/(close*2))
NineMthRS = 0.2*(close/(close*3))
TwelveMthRS = 0.2*(close/(close*4))
Release Notes: Added a Green Dot on the RS for the 233 week high and Red Dot for the 233 week Low. This adds more intelligence to the RS line.
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 a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Hi Ravi,
Thanks for sharing this code, had been looking for this for a quick peak of RS.
I tried to change the comparatively symbol to SPY or other stock code, curve is updated but the score remains the same. do you know why? Thank!!!

@RISKyy, The score is individual Stock specific (not exactly IBD way). It has more weightage for the last 3 months, then 6 months, then 9 months and 12 months. I think IBD stores all the Companies for an Exchange and calculates the score.
My observation is my indicator is Similar to IBD ratings for the 80-95 Range. There will be stocks above 100 as well and this will show how bullish they are :)
Hi Ravi,
Thank you for sharing this. Can it be happen that relative strength value be over 100? I don't believe so but I found some stocks showing RS rating above 100.
For example, the value of $MVIS shows 105 as of Jan 7th, and $EDIT's shows 107. Thank you!
RaviYendru HIRO1023
@HIRO1023, My Observation is RS Ratings of 80 to 95 of my indicator are almost equivalent to IBD. I could have restricted the value of my Indicator to 99 but then i felt RS Rating above 100 was informative. I shows extremely bullish Companies in the last 3 months. I tend to be extra careful on this Companies :)
HIRO1023 RaviYendru
@RaviYendru, Ah, understood your intention and it is very suggestive. Companies above 100 are indeed extremely bullish. Thank you!
been looking for something like ibd's RS, Thankyou
Hi Ravi,
Can comparative relative strength value be zero or below zero? if yes then on the indicator, kindly request you to show zero line, it will help us to identify easily.

Also I would like to know what are green and red values - is it 233 weeks high price and 233 weeks low price? And what is 0.01 value in the indicator label?

RaviYendru sudhakar_kb
@sudhakar_kb, The Relative Strength is a division of the stock price vs Index (Nifty). It can never be Zero (Only possibility is if stock price is 0 :)). Green Dot is the 233 week high and red dot is 233 week low
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Private Messages Chat Sign Out