joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
818 stars 224 forks source link

getSymbols.yahoo is not working for currency symbol ZWDUSD=x #272

Closed sureshvigneshbe closed 5 years ago

sureshvigneshbe commented 5 years ago

while downloading the historical currency rate of ZWDUSD=x symbol , using the below code.

getSymbols(Symbols = "ZWDUSD=x",
           env = .GlobalEnv,
           reload.Symbols = FALSE,
           verbose = FALSE,
           warnings = TRUE,
           src = "yahoo",
           symbol.lookup = TRUE,
           auto.assign = getOption('getSymbols.auto.assign',TRUE),
           from = "2019-08-01",
           to = Sys.Date()+1)

Getting below error

dcadusd<-data.frame(get.hist.quote(instrument = "ZWDUSD=x", start = date,
+                                    quote = "Close",retclass = "zoo"))
Warning: ZWDUSD=x download failed; trying again.
Error in getSymbols.yahoo(Symbols = "ZWDUSD=x", env = <environment>, verbose = FALSE,  : 
  Unable to import “ZWDUSD=x”.
ZWDUSD=x download failed after two attempts. Error message:
HTTP error 404.

Request to help anyone on the issue.

Rsession info :

sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] quantmod_0.4-15 TTR_0.23-4      xts_0.11-2      zoo_1.8-5       ROracle_1.3-1   DBI_1.0.0       tseries_0.10-46

loaded via a namespace (and not attached):
[1] compiler_3.4.2  tools_3.4.2     curl_3.3        grid_3.4.2      lattice_0.20-35 quadprog_1.5-5 
joshuaulrich commented 5 years ago

The error HTTP 404 means the page doesn't exist. Did this work for you in the past? I ask because it doesn't look like Yahoo Finance provides quotes for that exchange rate. Here are my my search results.

For what it's worth, getFX works (but only provides limited history):

R> getFX("ZWD/USD")
[1] "ZWD/USD"
R> head(ZWDUSD)
            ZWD.USD
2019-03-03 0.002668
2019-03-04 0.002668
2019-03-05 0.002668
2019-03-06 0.002668
2019-03-07 0.002668
2019-03-08 0.002668

Tiingo is a better data provider than Yahoo Finance, and they also provides FX data. But it doesn't look like they have the ZWD/USD cross rate either. @tiingo, can you confirm?

tiingo commented 5 years ago

Thanks for inquiring @joshuaulrich - unfortunately we do not cover ZWD. It's an exotic and this data is a bit more difficult to nail down.

joshuaulrich commented 5 years ago

@sureshvigneshbe I'm closing this because the problem is that the series isn't available. There's nothing I can change in quantmod to fix that. I checked other sources (FRED, Quandl) and they don't seem to have the series either.

sureshvigneshbe commented 5 years ago

Thank you all for the support.

sureshvigneshbe commented 5 years ago

Also getting similar errors for the below list of currencies.Whether all are similar errors simpleWarning: FKPUSD=X download failed; trying again. simpleWarning: JEPUSD=X download failed; trying again. simpleWarning: TVDUSD=X download failed; trying again. simpleWarning: BAMUSD=X download failed; trying again. simpleWarning: GIPUSD=X download failed; trying again. simpleWarning: KGSUSD=X download failed; trying again. simpleWarning: KPWUSD=X download failed; trying again. simpleWarning: GGPUSD=X download failed; trying again. simpleWarning: SBDUSD=X download failed; trying again. simpleWarning: ZWDUSD=X download failed; trying again. simpleWarning: AZNUSD=X download failed; trying again. simpleWarning: SHPUSD=X download failed; trying again. simpleWarning: VEFUSD=X download failed; trying again. simpleWarning: MNTUSD=X download failed; trying again. simpleWarning: SRDUSD=X download failed; trying again. simpleWarning: IMPUSD=X download failed; trying again. simpleWarning: USDUSD=X download failed; trying again.

sureshvigneshbe commented 5 years ago

simpleWarning: USDUSD=X download failed; trying again. please ignore this one.