

hi,

I have a time series of tick data and I am trying to get the aggregate volume for every 3-minutes for the tick data that I have converted into OHLC format (so I can use some of the nice functionalities of quantmod for my analysis). 

I have written the following code, but do
 not know how to get the aggregate volume for the 3-minutes in that OHLC for some 
volume analysis (so I can use aggregate(Vo(x)) etc.). 

library(tseries)
library(xts)
library(quantmod)


x = read.table("tick.dat", header = FALSE, sep="\t", skip=0)
x
             V1    V2               V3    V4    V5    V6       V7 V8  V9
11107  U10 2010-07-01  1      1453 9160 TRUE  N  N   2
11108  U10 2010-07-01  1      1453 9160 TRUE  N  N   1
11109  U10 2010-07-01  1      1454 9155 TRUE  N  N   4
11110  U10 2010-07-01  1      1455 9155 TRUE  N  N   3
11111  U10 2010-07-01  1      1455 9155 TRUE  N  N   1

dt<-sprintf("%s %04d",x$V2,x$V4) 
dt<-as.POSIXlt(dt,format="%Y-%m-%d %H%M")

y <- data.frame(dt,x$V5,x$V9)
colnames(y) <- c("Date","Price","Volume")
str(y)

z <- xts(y[,2], y[,1]) 

tickmin <- to.minutes3(z, OHLC=TRUE)

Can anyone please suggest how I get the aggregate volume by 3-minutes into my OHLC series.

 		 	   		  
	[[alternative HTML version deleted]]

