Get legend

I am trying to get OHLC price data for currency pairs. As you can see below, I managed to get a closing price for a certain period of time. Ideally, I would also like the prices of Open, High and Low. From there, I am going to analyze the data to create a forex trading system.

Here is my work:

> getSymbols("GBP/USD",src="oanda", from="2014-05-30", to= "2014-06-14")  
[1] "GBPUSD"  
Warning message:  
In download.file(paste(oanda.URL, from.date, to.date, "exch=", currency.pair[1],  :  
  downloaded length 18395 != reported length 200  
> last(GBPUSD,4)    
               GBP.USD  
2014-06-11  1.6787  
2014-06-12  1.6773  
2014-06-13  1.6820  
2014-06-14  1.6959  
+4
source share
1 answer

Yahoo provides free daily OHLC currency data for at least currencies converted into US dollars, which can be accessed via quantmod:

library(quantmod)
getSymbols("GBP=X",src="yahoo",from="2005-01-01")
getSymbols("AUD=X",src="yahoo",from="2005-01-01")
getSymbols("EUR=X",src="yahoo",from="2005-01-01")
# `EUR=X` (which is USD/EUR) is the number of Euros per 1 USD.

tail(`EUR=X`)
# EUR=X.Open EUR=X.High EUR=X.Low EUR=X.Close EUR=X.Volume EUR=X.Adjusted
# 2016-08-05    0.89811   0.905050  0.895940     0.89809            0        0.89809
# 2016-08-08    0.90190   0.903040  0.900414     0.90175            0        0.90175
# 2016-08-09    0.90197   0.903179  0.899119     0.90223            0        0.90223
# 2016-08-10    0.89943   0.899430  0.892857     0.89962            0        0.89962
# 2016-08-11    0.89397   0.897827  0.893580     0.89394            0        0.89394
# 2016-08-12    0.89775   0.898260  0.891266     0.89774            0        0.89774

: , FX . : API Yahoo

, , FX Yahoo. (FX)

+3

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


All Articles