forexpirate

EURUSD pairs combined slopes

64 2 1
Most correlated pairs for EURUSD             using Oanda's correlation data. Look forward to pro/con comments.

Check comments for updates.
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study(title="EURUSD pairs combined slopes", 
     shorttitle="EURUSD pairs combined slopes")
// Add the inputs
l = input(title="Length", type=integer,
     defval=8, minval=5)
smaLength = input(title="EMA length", type=integer,
     defval=8, minval=5)
p0 = input(title="Other data series", type=symbol,defval="FX_IDC:chfhkd")
p1 = input(title="Other data series", type=symbol,defval="FX_IDC:eurhkd")
p2 = input(title="Other data series", type=symbol,defval="FX_IDC:gbpaud")
p3 = input(title="Other data series", type=symbol,defval="FX_IDC:usdchf")
p4 = input(title="Other data series", type=symbol,defval="FX_IDC:usdnok")
p5 = input(title="Other data series", type=symbol,defval="FX_IDC:usdsek") 
p6 = input(title="Other data series", type=symbol,defval="FX_IDC:cadhkd")
p7 = input(title="Other data series", type=symbol,defval="FX_IDC:gbpnzd")
p8 = input(title="Other data series", type=symbol,defval="FX_IDC:usdcad")
p9 = input(title="Other data series", type=symbol,defval="FX_IDC:eurusd")
//p10 = input(title="Other data series", type=symbol,defval="FX_IDC:nzdchf")
//p11 = input(title="Other data series", type=symbol,defval="FX_IDC:nzdcad")
// Get the additional data series
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)
// 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)
sma0 = sma(s0, l)
sma1 = sma(s1, l)
sma2 = sma(s2, l)
sma3 = sma(s3, l)
sma4 = sma(s4, l)
sma5 = sma(s5, l)
sma6 = sma(s6, l)
sma7 = sma(s7, l)
sma8 = sma(s8, l)
sma9 = sma(s9, l)
//sma10 = sma(s10, l)
//sma11 = sma(s11, l)
m0 = (sma0-sma0[1])*corr0
m1 = (sma1-sma1[1])*corr1
m2 = (sma2-sma2[1])*corr2
m3 = (sma3-sma3[1])*corr3
m4 = (sma4-sma4[1])*corr4
m5 = (sma5-sma5[1])*corr5
m6 = (sma6-sma6[1])*corr6
m7 = (sma7-sma7[1])*corr7
m8 = (sma8-sma8[1])*corr8
m9 = (sma9-sma9[1])*corr9
//m10 = (sma10-sma10[1])*corr10
//m11 = (sma11-sma11[1])*corr11
compm = m0+m1+m2+m3+m4+m5+m6+m7+m8+m9

compmave = sma(compm, smaLength)
// Plot values
plot(series=compm,title="Combined Slope", color=green)
plot(series=compmave, color=purple, linewidth=3, title="Average")
hline(0, color=red)
This script was updated: EURUSD pairs combined slopes V2
kakola
4 months ago
So the less they're correlated, the less they're going to affect the overall plot?
Reply
forexpirate PRO kakola
4 months ago
I looked for pairs that are correlated to EURUSD to track them as a group. The idea being as the group goes so does the individual. I am trying to sniff out trends when they begin, true meaningful trends. EURUSD may not be a good candidate. USD and EUR are the two most traded currencies -they make other currencies move. My indicators for GBPUSD GBPNZD NZDUSD EURNZD are probably better. Exotic pairs tend to get kicked around vs making the trend. There are some calculation mistakes in one, I will post updated code this very soon. Thank you for your question.
+1 Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out