Announcement

Collapse
No announcement yet.

How to get History all in one chunk

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

  • How to get History all in one chunk

    Let's say I'm requesting one full day of 1-tick-per-bar data.

    Most of the time when the Request History data comes back, it's the entire day's history, in one chunk, in chronological order.

    But sometimes, the data comes back in two chunks. In these cases, the first history chunk may be from mid-day to end-of-day. And the second history chunk will be from start-of-day to mid-day.

    I run analysis after a FillHistory, but, this means that the analysis runs after the first chunk... before the second chunk comes back. And worse, the two chunks aren't in chronological order when appended back-to-back.

    Is there a way to send the RequestHistory such that it forces the history returned to be in one, single chunk, everytime?

    Or is there a flag telling me that, indeed, all chunks have returned and no more are pending?

    Or is there an easier way? (I've only been desktop API programming for 5 days)
    Last edited by dudley7; 09-01-2006, 12:29 PM.

  • #2
    Unfortunately, there isn't a way to force the return chunk size to be 1. You will have to sort your data bars by time if needed.
    I am assuming that you are calling the RequestHistory function with btDays set to 1 and interval set to "1T".

    You might also want to look into the Time and Sales functionality of the Desktop API in our VB Sample.

    Comment


    • #3
      Yup, interval is 1T.

      I've resorted to ordering the chunks in an array, running through the data each time there's a new chunk: can't sort by time since tick data have multiples during the same second.

      Method works, though, thanks. Just was wondering if there was a flag somewhere.

      My FillHistory tests to see if the most recent chunk is the last chunk by checking its first tick trade time. If it's larger than 7:00 a.m. then I assume it's not the final chunk. (it works if my stocks don't have a first tick after 7:00 am).

      Anyway, I should get to know Time and Sales better... it's just that the History function is already working so smoothly, otherwise.

      Comment

      Working...
      X