Relative Strength Universal

Relative strength is a ratio between two assets, generally it is a stock and a market average (index). RS implementation details are explained here.

This script automatically decides benchmark index for RS calculation based on market cap input values and input benchmark indices values.

Relative strength calculation:
"To calculate the relative strength of a particular stock, divide the percentage change over some time period by the percentage change of a particular index over the same time period". This indicator value oscillates around zero. If the value is greater than zero, the investment has been relatively strong during the selected period; if the value is less than zero, the investment has been relatively weak.

In this script, You can input market cap values and all are editable fields. If company market cap value is grater than 75000(Default value) then stock value will be compared with Nifty index. If company market cap is between 75000 and 25000 then stock value will be compared with midcap 150 to calculate RS. If marketcap is greater than 5000 and less than 25000 then RS will be calculated based on smallcap250. If marketcap is less than 5000 and greater than 500 then it will be compared with NIFTY_MICROCAP250
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.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?