1
我已经使用quantmod与每日股票数据。 Quantmod自动从谷歌/雅虎金融网站下载数据,并自动转换为xts对象作为索引的日期。如何在xts中索引一分钟的盘中数据?
AAPL.Open AAPL.High AAPL.Low AAPL.Close AAPL.Volume AAPL.Adjusted
2014-10-01 100.59 100.69 98.70 99.18 51491300 97.09741
2014-10-02 99.27 100.22 98.04 99.90 47757800 97.80230
2014-10-03 99.44 100.21 99.04 99.62 43469600 97.52818
2014-10-06 99.95 100.65 99.42 99.62 37051200 97.52818
2014-10-07 99.43 100.12 98.73 98.75 42094200 96.67644
2014-10-08 98.76 101.11 98.31 100.80 57404700 98.68340
2014-10-09 101.54 102.38 100.61 101.02 77376500 98.89877
现在我与我转化成6列的数据帧(DF)一种分钟持续时间的盘中数据(CSV格式)沃金。
Date Time Open High Low Close
1 20150408 09:17:00 7.15 7.15 7.10 7.10
2 20150408 09:18:00 7.15 7.15 7.15 7.15
3 20150408 09:19:00 7.10 7.10 7.10 7.10
4 20150408 09:20:00 7.10 7.10 7.05 7.10
5 20150408 09:21:00 7.10 7.15 7.10 7.10
6 20150408 09:22:00 7.10 7.10 7.05 7.10
现在怎么这个数据帧转换为时间序列以这样的方式,我可以用默认quantmod功能,如Cl(),OP(),OHLC()等