Skip to content

getSymbols.oanda fails due to unexpected response from oanda.com #388

@66NsaIm4EJ

Description

@66NsaIm4EJ

Description

getSymbols.oanda() and functions that call it such as getFX and getMetals() fail with a warning message that they are unable to import data and error messages indicating that unexpected, unparseable output was received from oanda.com:

getSymbols.oanda("EUR/USD",from="2023-07-01",to="2023-07-07",auto.assign=FALSE)
Warning: Unable to import “EUR/USD”.
lexical error: invalid char in json text.
<html lang="en"
(right here) ------^

Error in getSymbols.oanda("EUR/USD", from = "2023-07-01", to = "2023-07-07", :
object 'fr' not found

Expected behavior

Functions return price data from oanda.com

Minimal, reproducible example

library(quantmod)
getFX("CAD/USD")
getSymbols.oanda("EUR/USD",from="2023-07-01",to="2023-07-07",auto.assign=FALSE)
getMetals(c("gold","XPD"))

Session Info

R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] quantmod_0.4.20   TTR_0.24.3        xts_0.12.2        zoo_1.8-11       
[5] data.table_1.14.4

loaded via a namespace (and not attached):
[1] compiler_4.2.2  curl_4.3.3      grid_4.2.2      jsonlite_1.8.3 
[5] lattice_0.20-45

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions