I'm back with my problems about aggregating tick data (R : Tick data adding value when tick data is missing)
I've followed all your advices and it works perfectly. But I've got a problem with the calendar : mu xts object is indexed with a dateTime object that doesn't respect the open and close hours of the SX5E index.
For example : the SX5E index closes at 23:00 but there are still prices after 22:00!
2010-02-08 22:58:59 2624
2010-02-08 22:59:59 2624
2010-02-08 23:00:59 2624
2010-02-08 23:01:59 2624
2010-02-08 23:02:59 2624
2010-02-08 23:03:59 2624
2010-02-08 23:04:59 2624
2010-02-08 23:05:59 2624
2010-02-08 23:06:59 2624
2010-02-08 23:07:59 2624
I guess I can solve the problem by modifiying a little bit the second line of Joshua Ulrich's code : (R : Tick data adding value when tick data is missing)
price_1m <-to.period(price,period="minutes",k=1,OHLC=FALSE)
onemin <- seq(start(price_1m),end(price_1m),by="1 min")
Price_1m <- na.locf(merge(price_1m, xts(,onemin)))[onemin]
but I don't know how to generate a 1 min equally spaced sequence from 08:00:00 to 23:00:00. (Maybye using seq.POSIXt?) Any idea?