I have an irregular time series of all trades of a given ETF over a span of 4 years:
> head(BKF.xts)
BKF.xts
2008-01-02 09:30:01 59.870
2008-01-02 09:38:04 59.710
2008-01-02 09:39:51 59.612
2008-01-02 09:51:16 59.640
2008-01-02 10:06:08 59.500
> tail(BKF.xts)
BKF.xts
2011-12-30 15:59:23 36.26
2011-12-30 15:59:53 36.26
2011-12-30 15:59:56 36.27
2011-12-30 15:59:57 36.27
2011-12-30 15:59:58 36.27
2011-12-30 16:00:00 36.33
What I would like is to have the prices at every 5 minute interval for ALL trading days. Because I am dealing with ETFs it's possible that there are dates where the market is open that the ETF did not trade and so there will be no data for that date in my sample. However i need my final time series to account for all trading days. I have downloaded daily data for the same period so that I have another time series of every trading day. Not sure if that helps.
Also if there is no particular trade at one 5:00 minute time stamp I would like for the price of the most recent trade that took place. So for the data i posted above, what I would want is:
> head(BKF.xts)
BKF.xts
2008-01-02 09:35:00 59.870
2008-01-02 09:40:00 59.612
2008-01-02 09:45:00 59.612
2008-01-02 09:50:00 59.640
2008-01-02 09:55:00 59.640
Any help is greatly appreciated.