Search code examples
rimportcurrencyyahoo

Import stock price from Yahoo Finance into R?


I want to to import the currency close price from Yahoo finance or Oanda into R.

I tried to follow the same steps as mentioned in similar question: Import stock price from Yahoo Finance into R?

But I am receiving NA data instead

getQuote("EUR/USD", what=yahooQF("Last Trade (Price Only)"))

Trade         Time Last
EUR/USD       <NA>  N/A

Would appreciate any advises


Solution

  • I think this is what you're after.

    library(quantmod)
    getSymbols("EUR=X",src="yahoo")