Exact time stamp for currency data (FX)

we can collect daily data from the finances of Oanda and Yahoo using the package quantmodas such:

getFX("USD/JPY",from="2007-01-01", to = Sys.Date())
getSymbols("EUR=X",src="yahoo",from="2002-01-01",auto.assign=F)

After carefully checking the data, you may notice that the values ​​from these sources vary significantly. Then I wonder, what exactly is the time to timestamp for each source? He doesn't look at midnight GMT.

I would appreciate it if you have a key. Thank.

+3
source share
1 answer

FX , , , , (, -, ) ( 17:00 EST (America/New_York) 17:00 EST). . , Yahoo EUR/USD:

library(quantmod)
getFX("EUR/USD",from="2007-01-01", to = Sys.Date())
ya2 <- getSymbols("EUR=X",src="yahoo",from="2002-01-01",auto.assign=F)

# Yahoo reports the unconventional pricing of USDEUR = 1 / EURUSD, so lets get in the conventional form EUR/USD:
ya2[, c(1, 4, 6)] <- 1 / coredata(ya2)[, c(1, 4, 6)]
ya2[, c(2, 3)] <- 1 / coredata(ya2)[, c(3, 2)]

tail(ya2, 5)
# > tail(ya2, 5)
# EUR=X.Open EUR=X.High EUR=X.Low EUR=X.Close EUR=X.Volume EUR=X.Adjusted
# 2016-12-20   1.040474   1.041992  1.035518    1.040583            0       1.040583
# 2016-12-21   1.039393   1.045151  1.038529    1.039047            0       1.039047
# 2016-12-22   1.042753   1.049759  1.042753    1.042862            0       1.042862
# 2016-12-23   1.043950   1.046792  1.042970    1.043765            0       1.043765
# 2016-12-26   1.045588   1.047011  1.044600    1.045478            0       1.045478
colnames(EURUSD) <- "Oanda"
compare <- merge(ya2, EURUSD)
indexFormat(compare) <- "%Y-%m-%d, %a"

tail(round(compare, 4), 15)
# EUR.X.Open EUR.X.High EUR.X.Low EUR.X.Close EUR.X.Volume EUR.X.Adjusted  Oanda
# 2016-12-13, Tue     1.0643     1.0653    1.0607      1.0642            0         1.0642 1.0629
# 2016-12-14, Wed     1.0630     1.0667    1.0615      1.0629            0         1.0629 1.0632
# 2016-12-15, Thu     1.0515     1.0525    1.0404      1.0514            0         1.0514 1.0468
# 2016-12-16, Fri     1.0418     1.0472    1.0404      1.0419            0         1.0419 1.0435
# 2016-12-17, Sat         NA         NA        NA          NA           NA             NA 1.0451
# 2016-12-18, Sun         NA         NA        NA          NA           NA             NA 1.0451
# 2016-12-19, Mon     1.0448     1.0482    1.0413      1.0450            0         1.0450 1.0446
# 2016-12-20, Tue     1.0405     1.0420    1.0355      1.0406            0         1.0406 1.0391
# 2016-12-21, Wed     1.0394     1.0452    1.0385      1.0390            0         1.0390 1.0413
# 2016-12-22, Thu     1.0428     1.0498    1.0428      1.0429            0         1.0429 1.0443
# 2016-12-23, Fri     1.0440     1.0468    1.0430      1.0438            0         1.0438 1.0445
# 2016-12-24, Sat         NA         NA        NA          NA           NA             NA 1.0455
# 2016-12-25, Sun         NA         NA        NA          NA           NA             NA 1.0455
# 2016-12-26, Mon     1.0456     1.0470    1.0446      1.0455            0         1.0455 1.0455
# 2016-12-27, Tue         NA         NA        NA          NA           NA             NA 1.0449

Yahoo:

  • -, , yahoo OHLC. , , yahoo (EUR.X.Close), UTC. () FX.

  • , , Open (EUR.X.Open) , , - 24- UTC ( ). Yahoo "" "", , .

  • FX 24/5, yahoo .

Oanda:

5 EST , , , FX. FX , 5 EST 17:00 , 5 , 5 .. 5 .

, , FX. FX , :

+2

Source: https://habr.com/ru/post/1544574/


All Articles