[英]Plotting currencies given time and currency using quantmod and google finance
[英]plotting High Frequency finance data using quantmod
嗨我有像這樣的xts格式的數據
> ITXxts
Time Price Volume
2014-07-18 09:00:00 67.63 460
2012-04-27 09:00:00 67.63 73
2012-04-27 09:00:00 67.63 85
2012-04-27 09:00:01 67.63 3
2012-04-27 09:01:03 67.79 1
2012-04-27 09:01:16 67.64 91
2012-04-27 09:05:50 67.83 75
現在將該系列聚合成5分鍾的塊
tsagg5min =aggregatets(ITXxts,on="minutes",k=5)
2014-07-18 09:05:00 67.45 43
2014-07-18 09:10:00 67.82 12
2014-07-18 09:15:00 67.91 341
2014-07-18 09:20:00 67.70 275
ChartSeries中(tsagg5min)
現在我的問題是我想以OHLC格式繪制它,以便計算數據聚合的每個5分鍾塊的開放高低和關閉
xts
包(由quantmod加載)具有轉換為OHLC條的功能。
tsagg5min <- to.minutes5(ITXxts)
#tsagg5min <- to.minutes(ITXxts, k=5) # identical
#tsagg5min <- to.period(ITXxts, endpoints(ITXxts, "minutes", k=5)) # identical
chartSeries(tsagg5min)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.