Announcement

Collapse
No announcement yet.

Historical Bars, Events Raised

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Historical Bars, Events Raised

    I'm requesting 2 days of historical 30 second bars at 8:30 AM, which gets me data from yesterday, as expected.

    The OnBarsReceived event fires and all of the bars from yesterday are there and processed. Then, OnBarsChanged fires and the same bars are there.

    Why is this happening?

    Also, is there some reason I'm not appreciating for having these two events which require the same processing?

    Also, I would have expected these bars to be timed on the minute and half-minute. Instead, the minute times vary with second reading from 00 to 02. Similarly, the half-minute times occur anywhere from 30 to 32.

  • #2
    That is the way the API is designed. The loading of the bars loads the data into an array on "the other side" of the API. Your calls to GetBar just index into the array. When a new bar comes in it is just added to the array. It does not empty the array and start again with just the new bar(s).

    My guess as to why the bar times are not always exact 30 second intervals is that there may not have been a trade at 8:31:30, but there was one at 8:31:32, which is the first trade in that bar. The second interval bars are built from tick data, so that might seem like a reasonable guess. I'm not 100% sure though as I've never looked at the issue.

    Cheers... George

    Comment

    Working...
    X