forexpirate

EURNZD pairs combined slopes

93 0 16
Indicator that combines slopes of most correlated pairs to EURNZD             . Pairs were chosen using Oanda's correlation data. It combines highly correlated EURNZD             pairs slopes to get a broad picture of the pressures on EURNZD            
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
study(title="EURNZD pairs combined slopes", 
     shorttitle="EURNZD pairs combined slopes")
// Add the inputs
l = input(title="Length", type=integer,
     defval=20, minval=5)
smaLength = input(title="EMA length", type=integer,
     defval=21, minval=5)
p1 = input(title="Other data series", type=symbol,defval="FX_IDC:NZDCAD")
p2 = input(title="Other data series", type=symbol,defval="FX_IDC:nzdchf")
p3 = input(title="Other data series", type=symbol,defval="FX_IDC:nzdsgd")
p4 = input(title="Other data series", type=symbol,defval="FX_IDC:nzdusd")
p5 = input(title="Other data series", type=symbol,defval="FX_IDC:audnzd") 
// Get the additional data series
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)
// Calculate correlation and slopes
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)
sma1 = sma(s1, l)
sma2 = sma(s2, l)
sma3 = sma(s3, l)
sma4 = sma(s4, l)
sma5 = sma(s5, l)
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
compm = m1+m2+m3+m4+m5
//m1+m2+m3+m4+m5
compmave = sma(compm, smaLength)
// Plot values
plot(series=compm)
plot(series=compmave, color=orange, linewidth=3)
plot(0)
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out