I have collected one-minute 'tick' share price data for a number securities over a period of weeks, and stored these in a table called 'intraday'. This table includes one-minute tick data between 08:01:00 and 16:30:00 each trading day.
Some securities do not trade every minute of every day, and when they do not trade, no row is created (missing ticks). I was hoping to insert rows for all missing ticks, which would carry across the share price from the previous share price, with a trade volume of '0' for these ticks.
For example, currently for one security I have the following stored:
ticker date tick cls volume
ASC 20151231 1899-12-30 12:30:00 3453 2743
ASC 20151231 1899-12-30 12:29:00 3449 3490
ASC 20151231 1899-12-30 12:28:00 3436 930
ASC 20151231 1899-12-30 12:27:00 3435 255
ASC 20151231 1899-12-30 12:26:00 3434 4
ASC 20151231 1899-12-30 12:23:00 3444.59 54
(apologies for the annoying 1899-12-30 dates for each tick - these make it look a bit messy but do no harm, hence why they remain there currently)
What I would ideally like to be stored, is this:
ticker date tick cls volume
ASC 20151231 1899-12-30 12:30:00 3453 2743
ASC 20151231 1899-12-30 12:29:00 3449 3490
ASC 20151231 1899-12-30 12:28:00 3436 930
ASC 20151231 1899-12-30 12:27:00 3435 255
ASC 20151231 1899-12-30 12:26:00 3434 4
ASC 20151231 1899-12-30 12:25:00 3444.59 0 < new row
ASC 20151231 1899-12-30 12:24:00 3444.59 0 < new row
ASC 20151231 1899-12-30 12:23:00 3444.59 54
So, for each distinct ticker and date value, there would be a range of values for each minute between 08:01:00 and 16:30:00. Some would be as they are currently stored, and the others would have a volume figure of 0, and a close value that copies the previous close value.
I'm absolutely stumped, and would appreciate any help you could potentially offer on this!
Kind regards.