[英]get Symbols quantmod OHLC currency data
I am trying to retrieve the OHLC Price data for currency pairs. 我正在尝试检索货币对的OHLC价格数据。 As you can see below I have managed to get the Close price for a defined period of time.
正如您在下面所见,我已经设法在一段规定的时间内获得收盘价。 Ideally I would also like the Open, High and Low prices too.
理想情况下,我也想要开盘价,最高价和最低价。 From there I aim to analyse the data to create a forex trading system.
从那里我的目标是分析数据,以创建一个外汇交易系统。
Here is my work so far: 到目前为止,这是我的工作:
> 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
Yahoo provides free daily currency data in OHLC format for at least currencies converted to USD, which can be accessed via quantmod
: 雅虎提供OHLC格式的免费每日货币数据,至少转换为美元的货币,可以通过
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
Note that volume is not available by most data providers as FX is an OTC market. 请注意,大多数数据提供商都无法使用交易量,因为FX是场外交易市场。 The answers to this question might also be useful to you: yahoo API discussion
这个问题的答案也可能对您有用: 雅虎API讨论
Notwithstanding, be aware of the caveats discussed here when using Yahoo daily fx data. 尽管如此,请注意使用Yahoo每日fx数据时所讨论的注意事项。 Exact time stamp on quantmod currency (FX) data
quantmod货币(FX)数据的确切时间戳
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.