minute bar time stamp alignment
The convention is to align with the start of the bar period, not the end. But the following line of code returns 1-min bars that align with the end of the bar period. I don't have access to IQFeed's API documentation and not sure if this is by design or not.
If possible, could you kindly look into this and shift the time stamps by 1 period from end to start? e.g. "2016-08-18 18:01:00 2183.50 2183.75 2183.25 2183.50 347" should be "2016-08-18 18:00:00 2183.50 2183.75 2183.25 2183.50 347"
Thanks a lot!
ESU16 <- get_iqfeed_data('@ESU16', '2016-08-18 18:00:00', '2016-08-19 17:00:00', '1min')
time open high low close volume 2016-08-18 18:01:00 2183.50 2183.75 2183.25 2183.50 347 2016-08-18 18:02:00 2183.75 2184.00 2183.75 2184.00 108 2016-08-18 18:03:00 2184.00 2184.00 2183.75 2183.75 91 ... ... 2016-08-19 16:58:00 2182.00 2182.25 2182.00 2182.25 217 2016-08-19 16:59:00 2182.25 2182.25 2182.00 2182.00 173 2016-08-19 17:00:00 2182.25 2182.50 2182.00 2182.50 237
Comments (3)
-
repo owner -
reporter Stanislav, thanks for the confirmation and suggestion! I will try your suggested approach and adjust the timestamp to match the convention of my other program and data sources.
-
repo owner - changed status to resolved
- Log in to comment
The time stamps for the data are on the close of the bar and I wouldn't recommend changing it but if you want you could change it this way:
In terms of data streams time of the bar is time it was formed i.e. 18:01 gives you summary of ticks came between (18:00,18:01] in case of 1min bars. Not a bug but I agree I should have added a note somewhere in documentation.