2013-04-05 57 views
1

任何人都知道ETF历史数据的免费来源?我想将数据加载到R服务器进行分析。我已经看过雅虎YQL API的雅虎财经表,但是这些数据是每日数据,我想根据历史价格进行比较。获取ETF历史数据的指数

谢谢

回答

3

尝试quantmod包。

require(quantmod) 

SPY <- getSymbols("SPY", from = "2005-01-01", to = "2008-12-31", auto.assign = FALSE) 

head(SPY) 
##   SPY.Open SPY.High SPY.Low SPY.Close SPY.Volume SPY.Adjusted 
## 2005-01-03 121.56 121.76 119.90 120.30 55748000  101.76 
## 2005-01-04 120.46 120.54 118.44 118.83 69167600  100.52 
## 2005-01-05 118.74 119.25 118.00 118.01 65667300  99.83 
## 2005-01-06 118.44 119.15 118.26 118.61 47814700  100.33 
## 2005-01-07 118.97 119.23 118.13 118.44 55847700  100.19 
## 2005-01-10 118.34 119.46 118.34 119.00 56563300  100.66