Percentage Relative Strength

A relative strength indicator that compares your main symbol (one on your chart) strength to another symbol by percentage.
The result is plotted as a histogram showing which symbol is rising or falling more in percentage.
In case your chart symbol is TSLA ( Tesla ) and the indicator 'Symbol to compare' is SPX:

GREEN area (above zero) means TSLA is rising more than the SPX .
RED area (below zero) means TSLA is falling more than the SPX .

To these who wants to understand calculation, it's pretty straightforward.
For each asset we calculate everyday percentage change based on previous close and current close.
We take main asset (chart symbol) percentage and subtract it from percent of change of the symbol we want to compare to.
Result are smoothed by SMA ( Simple Moving Average )
You can select different indexes or cfds such as S&P500 (SPX) , NASDAQ 100 ( NSX ), RUSSELL 2000 (RUT) and NASDAQ (IXIC).
Default is S&P 500 (SPX) .

Enjoy and Like if you like.
Release Notes: NEW: Added option to add your own symbol! Just fill the input box with the symbol you want to compare to or use predefined presets.
Added more moving averages (EMA, RMA and WMA)
Skript med en öppen källkod

I sann TradingView-anda har författaren till detta skript publicerat det som öppen källkod, så att handlare kan förstå och verifiera det. Skål för författaren! Du kan använda den gratis men återanvändning av den här koden i en publikation regleras av våra Ordningsregler. Du kan göra den till favorit för att använda den i ett diagram.

Vill du använda det här skriptet i ett diagram?
Appreciation of my work:

Premium Pivot Points Algo Indicator:


Hi, this is good indicator to know the underline stock performance against its Index.
But why setting is restricted to S&P?
I am from India & we are trading in NSE Nifty50 Index.
NSE NIFTY50 index is not there to compare its stocks against the benchmark.
Can you please edit the setting & open it for all Market & their Indices?
It will be a great help to all the traders.
Thank you. 👍 👍👍
dman103 Tech_Milind
@Tech_Milind, Hey, Thanks, i agree, relative strength indicators are useful, regarding S&P restriction, the initial indicator was design to compare assets (stocks) to US indexes which is useful for me and i shared with you all, note taken, Like Script/Follow me to get notified, will do a redesign or make new script in the near future and include an option to add any symbol + will add more moving averages varieties + more features.
@dman103, Thanks a lot. It will be great to all traders who are trading in different markets.
I know its really a painful job, but I appreciate your efforts for goodwill of community.
And yes, will following you.😊
Thanks. 👍👍👍
+1 Svara
dman103 Tech_Milind
@Tech_Milind, Right, everything requires some job to get things done. i am happy to give and hopefully this will give you more winners, i have updated the script with option to add your own symbol to compare to + a few more moving averages.
@dman103, Thanks a lot. Have tested just now. And working fantastic.
Appreciated your efforts. 👍👍👍👍
Once again, thanks a lot for giving this indicator very fast.
Thank you.
+1 Svara
manis12345 Tech_Milind
@Tech_Milind, hey i just modified for NIFTY & Banknifty index using this script, just copy it in Pine editor and save.
study("Percentage Relative Strength")
other_symbol = input(title="Compare To", defval="NIFTY", options=)
enable_smoothing=input(title="Enable SMA smoothing",defval=true)
length=input(title="SMA Length",defval=7)
close_main_sec=security(other_symbol, timeframe.period, close)
c = close
current_percent = (c-c)/c * 100
other_percent = (close_main_sec-close_main_sec)/close_main_sec * 100
var val=0.0
if (enable_smoothing)
plot(val,color= val>=0 ? color.lime :,style=plot.style_columns,linewidth=5)
Tech_Milind manis12345
@manis12345, Thank you Manis. For taking this pain. It is working absolutely fine.
Keep it up & thank you for helping. 👍👍👍
rmprotoss manis12345
@manis12345, for this formula current_percent = (c-c)/c * 100. I think it will always return 0 and chart show nothing.
Hi, Great tool ! Is there any way of changing what it compares it to? (Id like to use it to compare two different government bonds)
Thanks a lot! It's just what I was looking for. Is it used to analyze the weekly chart?