QuantFod getFX function error

I have been using the function in recent months, but over the last couple of days it has stopped working:

library(quantmod)
getFX("USD/JPY")

Error in open.connection(con, "rb") : HTTP error 404.

Does anyone else have the same problem? Any alternatives in R for loading FX data?

UPDATE : the creator of the quantum module provided a fix for the problem by simply copying the code to install it:

install.packages("curl")
library(devtools)
devtools::install_github("joshuaulrich/quantmod", ref="225_getsymbols_oanda") 
+4
source share
2 answers

I can reproduce your problems. You can use Yahoo or FRED:

library(quantmod)
getSymbols("DEXJPUS", src = "FRED")
getSymbols("JPY=X", src = "yahoo")

According to https://github.com/joshuaulrich/quantmod/issues/225 , this has been fixed in the development branch.

+1
source

Maybe Quandl, but you have to register. The key is free.

library(Quandl)

Quandl.api_key("NEED_FREE_KEY!!")

#q <- Quandl.search(query = "DEXJPUS", database_code = "FRED")
#Japan / U.S. Foreign Exchange Rate
#Code: FRED/DEXJPUS
#Desc: Japanese Yen to One U.S. Dollar Not Seasonally Adjusted, Noon buying     rates in New York City for cable transfers payable in foreign currencies. 
#Freq: daily
#Cols: Date | Value

jpus <- Quandl(code = "FRED/DEXJPUS", 
               type = "raw", 
               collapse = "monthly", 
               start_date = "2018-01-01", 
               end_date = "2018-03-01")
+1
source

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


All Articles