Correlation of chart symbol to different Index-ETF-currency

Script plots correlation of chart symbol to a variety of indexes, symbols, equities. ** Original idea was to find Bitcoin correlation, which I did not. Built in correlations are: Nikie, DAX , SPY , AAPL , US Dollar , Gold , EURUSD , USDCNY , EEM , QQQ , XLK , XLF , USDJPY , EURGBP
Supprimer des scripts favoris Ajouter aux scripts favoris
study(title="BITCOIN Index-ETF-currency Corr",  shorttitle="BITCOIN Index-ETF-currency Corr")
// Add the inputs
l = input(title="Length", type=integer,  defval=20, minval=5)

p0 = input(title="Other data series", type=symbol,defval="JPN")
p1 = input(title="Other data series", type=symbol,defval="DAX")
p2 = input(title="Other data series", type=symbol,defval="amex:SPY")
p3 = input(title="Other data series", type=symbol,defval="NASDAQ:aapl")
p4 = input(title="Other data series", type=symbol,defval="usdollar")
p5 = input(title="Other data series", type=symbol,defval="amex:gld") 
p6 = input(title="Other data series", type=symbol,defval="FX_IDC:EURUSD")
p7 = input(title="Other data series", type=symbol,defval="FX_IDC:usdcny")
p8 = input(title="Other data series", type=symbol,defval="amex:eem")
p9 = input(title="Other data series", type=symbol,defval="NASDAQ:qqq")
p10 = input(title="Other data series", type=symbol,defval="amex:xlk")
p11 = input(title="Other data series", type=symbol,defval="amex:xlf")
//p12 = input(title="Other data series", type=symbol,defval="FX_IDC:usdcnh")
p13 = input(title="Other data series", type=symbol,defval="FX_IDC:usdjpy")
p14 = input(title="Other data series", type=symbol,defval="FX_IDC:eurgbp")

s0= security(p0, period, close)
s1= security(p1, period, close)
s2= security(p2, period, close)
s3= security(p3, period, close)
s4= security(p4, period, close)
s5= security(p5, period, close)
s6= security(p6, period, close)
s7= security(p7, period, close)
s8= security(p8, period, close)
s9= security(p9, period, close)
s10= security(p10, period, close)
s11= security(p11, period, close)
//s12= security(p12, period, close)
s13= security(p13, period, close)
s14= security(p14, period, close)
// Calculate correlation and slopes
corr0 = correlation(close, s0, l)
corr1 = correlation(close, s1, l)
corr2 = correlation(close, s2, l)
corr3 = correlation(close, s3, l)
corr4 = correlation(close, s4, l)
corr5 = correlation(close, s5, l)
corr6 = correlation(close, s6, l)
corr7 = correlation(close, s7, l)
corr8 = correlation(close, s8, l)
corr9 = correlation(close, s9, l)
corr10 = correlation(close, s10, l)
corr11 = correlation(close, s11, l)
//corr12 = correlation(close, s12, l)
corr13 = correlation(close, s13, l)
corr14 = correlation(close, s14, l)
// SMA calc

plot(corr4,color=purple,title="US Dollar")
plot(corr10,color=teal,title="Tech ETF")
plot(corr11,color=orange,title="Fin ETF")


wow. nice work.. how to do alteration in this. and is there any way to include USDINR too in this..
It is a good work but I think is better if you can choice the symbols to show correlation
Something goes wrong. It doesn't work.
Hello, the task of the indicator is to show correlation. You can change what instruments you measure correlation.
Gorbie forexpirate
It works only on a daily view
I see. Then one or more of the symbols in the list do not have intraday prices. If you remove those then it will work.
Gorbie forexpirate
Okay! Well done. Great work mate!
Thank you, glad it will works for you now. I built it first hunting for bitcoin correlations. The goal was to see is anything drives bitcoin, even if for only a few months or so. I did not find anything really big in the bitcoin arena. But the script can be used for anything.
Accueil Screener d'actions Screener Forex Screener Crypto Calendrier économique Comment ça marche Caractéristiques du graphique Prix Parrainer un ami Règles de conduite Centre d'aide Solutions site web & courtier Widgets Solutions de cartographie Bibliothèque de graphiques allégés Blog & News Twitter
Profil Paramètres du Profil Compte et Facturation Amis référés Coins Mes tickets au support Centre d'aide Idées Publiées Followers Suivi(e) Messages privés Chat Se Déconnecter