US Dollar is primary currency for global transaction. In a nutshell, it becomes standard for any transaction value and currency strength of world countries. As we know, exporters, importers and investors are depending on the value of US Dollar .
Some believes that EURO DOLLAR contracts is one of primary indicator for US Dollar movements in spot market. It is simply because it can provide preliminary estimation about US Interest rate that will be announced by the FED periodically. EURO DOLLAR is a forward contract that represent time deposits denominated in U.S. dollars at banks outside the United States. EURO DOLLAR is traded at CME and the transaction are published in weekly periods by CFTC as one of future and option contracts of Commitment of Traders Report. EURO DOLLAR is completely different term with Eur/Usd pair in fx (forex/ currency) spot market.
This project is aimed to provide forecast of EURO DOLLAR in near future for decision making to invest or to have transaction in any related investment especially in the spot market.
I. Setting Up Necessary libraries
# Libraries
library(rmdformats)
library(dplyr)
library(Quandl)
library(quantmod)
library(TTR)
library(PerformanceAnalytics)
library(ggplot2)
library(gridExtra)II. Pre Processing
Quandl.api_key("CAbxE8kC3cDNKzrrs9fM") #Yufy Firdiansyah API Key
euro <- Quandl('CHRIS/CME_ED3')
cot <- Quandl('CFTC/132741_FO_L_ALL')
noncommercial <- cot$`Noncommercial Long`-cot$`Noncommercial Short`
commercial <- cot$`Commercial Long`-cot$`Commercial Short`## [1] TRUE
## [1] FALSE
## Observations: 1,352
## Variables: 9
## $ Date <date> 2020-04-09, 2020-04-08, 2020-04-07, 2...
## $ Open <dbl> 99.595, 99.595, 99.625, 99.655, 99.665...
## $ High <dbl> 99.645, 99.610, 99.625, 99.655, 99.670...
## $ Low <dbl> 99.585, 99.555, 99.580, 99.615, 99.635...
## $ Last <dbl> 99.630, 99.600, 99.600, 99.630, 99.650...
## $ Change <dbl> 0.035, 0.010, 0.035, 0.030, 0.010, 0.0...
## $ Settle <dbl> 99.635, 99.600, 99.590, 99.625, 99.655...
## $ Volume <dbl> 223154, 170530, 190753, 145372, 156027...
## $ `Previous Day Open Interest` <dbl> 1050132, 1052476, 1066955, 1065080, 10...
## Observations: 1,308
## Variables: 11
## $ Date <date> 2020-04-07, 2020-03-31, 2020-03-24...
## $ `Open Interest` <dbl> 27838752, 28096839, 27086678, 26398...
## $ `Noncommercial Long` <dbl> 1023336, 1040758, 1073688, 1339134,...
## $ `Noncommercial Short` <dbl> 1739553, 1684561, 1133480, 737946, ...
## $ `Noncommercial Spreads` <dbl> 16742892, 16974026, 16395686, 15887...
## $ `Commercial Long` <dbl> 9383859, 9442694, 9007736, 8513302,...
## $ `Commercial Short` <dbl> 8534045, 8656703, 8751865, 8932101,...
## $ `Total Long` <dbl> 27150087, 27457477, 26477110, 25740...
## $ `Total Short` <dbl> 27016490, 27315289, 26281031, 25557...
## $ `Nonreportable Positions Long` <dbl> 688665, 639362, 609567, 658022, 750...
## $ `Nonreportable Positions Short` <dbl> 822262, 781550, 805647, 840411, 893...
Below we could see comparation of Eurodollar dollar and COT legacy ,commercial or non commercial long & short position contract.
df <- merge(euros,cot,by.y='Date',by.x='Date')
g1 <- ggplot(data = df, aes(Date,Settle))+
geom_line()+ggtitle('Euro Dollar')
g2 <- ggplot(data = df, aes(Date,`Noncommercial Long`/1000000))+
geom_line(col='dark blue')+
geom_line(aes(y=`Noncommercial Short`/1000000),col='red')+
ggtitle('Non Commercial Position')+ylab('Position')
g3 <- ggplot(data = df, aes(Date,`Commercial Long`/1000000))+
geom_line(col='dark blue')+
geom_line(aes(Date,`Commercial Short`/1000000),col='red')+
ggtitle('Commercial Position')+ylab('Position')
grid.arrange(g1,g2,g3,nrow=3)Below we could see comparation of Eurodollar dollar and COT legacy ,commercial or non commercial net position contract.
df$noncom <- df$`Noncommercial Long`-df$`Noncommercial Short`
df$com <- df$`Commercial Long`-df$`Commercial Short`
c1 <- ggplot(data = df, aes(Date,Settle))+
geom_line()+ggtitle('Euro Dollar')
c2 <- ggplot(data = df, aes(Date,noncom/100000))+
geom_area(fill='dark blue')+
ggtitle('Non Commercial Position')+ylab('Position')
c3 <- ggplot(data = df, aes(Date,com/100000))+
geom_area(fill='dark red')+
ggtitle('Commercial Position')+ylab('Position')
grid.arrange(c1,c2,c3,nrow=3)Time Series model using ARIMA
The Step will be defined below: