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()等