dman103

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.
Versionshinweise: 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)
Open-source Skript

Ganz im Sinne von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es verstehen und überprüfen können. Ein Hoch auf den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Publikation unterliegt den Hausregeln. Sie können das Skript den Favoriten hinzufügen, um es auf dem Chart zu verwenden.

Möchten Sie dieses Skript auf einem Chart verwenden?
Appreciation of my work: https://paypal.me/dman103

Premium Pivot Points Algo Indicator: https://www.tradingview.com/script/LFBaHNuA-Pivot-Points-Algo/

Kommentare

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. 👍 👍👍
Tech_Milind
India.
Antworten
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.
Antworten
@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 Antworten
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.
Antworten
@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 Antworten
manis12345 Tech_Milind
@Tech_Milind, hey i just modified for NIFTY & Banknifty index using this script, just copy it in Pine editor and save.
//@version=4
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)
sec1=sma(current_percent,length)
sec2=sma(other_percent,length)
val:=sec1-sec2
else
val:=current_percent-other_percent
zero_line=plot(0,color=color.yellow,transp=70)
plot(val,color= val>=0 ? color.lime : color.red,style=plot.style_columns,linewidth=5)
Antworten
Tech_Milind manis12345
@manis12345, Thank you Manis. For taking this pain. It is working absolutely fine.
Keep it up & thank you for helping. 👍👍👍
Antworten
rmprotoss manis12345
@manis12345, for this formula current_percent = (c-c)/c * 100. I think it will always return 0 and chart show nothing.
Antworten
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)
Antworten
Thanks a lot! It's just what I was looking for. Is it used to analyze the weekly chart?
Antworten