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
從常用腳本中移除 新增至常用腳本
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.
首頁 股票篩選器 外匯篩選器 加密貨幣篩選器 全球財經日曆 如何運作 圖表功能 價格 推薦朋友 網站規則 幫助中心 網站 & 經紀商解決方案 小工具 圖表解決方案 輕量圖表庫 部落格 & 新聞 推特
概覽 個人資料設定 賬戶和賬單 推薦朋友 代幣 我的客服工單 幫助中心 發表的想法 粉絲 正在關注 私人訊息 在線聊天 登出