如何在R中下载历史和当前布伦特原油价格

时间:2019-05-22 09:01:30

标签: r quantmod quandl

作为标题,可以在R中下载历史和当前的布伦特原油价格吗?

我知道有quantmod软件包。而且我知道我可以从Yahoo!下载日期。像这样的财务:

library("quantmod")
getSymbols("BZ=F", src="yahoo", auto.assign = FALSE)

但是在这种情况下,我只能得到当前最近的期货价格,并且只能获得两周的时间(没有历史数据)。

我可以使用fred.stlouisfed:

library("quantmod")
getSymbols("DCOILBRENTEU", from=as.Date("2006-01-01"), to=Sys.Date(), src="FRED", auto.assign = TRUE)

,但是在这种情况下,数据会延迟(大约1周)。这就是布伦特(欧洲)-与原始布伦特原油价格不同。

我无法使用此处建议的Quandl包获取数据 Cannot download Brent Crude oil data from yahoo finance R。我得到了错误:

Error: {"quandl_error":{"code":"QECx02","message":"You have 
submitted an incorrect Quandl code. Please check your Quandl codes 
and try again."}}

0 个答案:

没有答案
相关问题