[R-SIG-Finance] Aggregating tick data

Matthew Gilbert matthew.gilbert12 at gmail.com
Mon Nov 14 04:01:34 CET 2011


Hi,

I have tick data for trade durations between 9:30 and 4:00 over the 
course of a month which I want to aggregate into 5 minute bins, starting 
from 9:30. What I currently have tried is

Durations.5min = 
period.apply(Data[,'Duration'],endpoints(Data[,'Duration'],on='minutes',k=5),FUN=mean)

however this returns bins starting from the first trade occurring on 
that day, and therefore my bins are not all the same over the course of 
the month.

Any suggestions are much appreciated.

Thanks,
Matt

-- 
Matthew Gilbert
Master of Quantitative Finance Candidate
University of Waterloo



More information about the R-SIG-Finance mailing list