Announcement

Collapse
No announcement yet.

OnBarsRecieved / OnBarsChanged

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

  • OnBarsRecieved / OnBarsChanged

    I am having a few issues with OnBarsReceived / OnBarsChanged. The problem is that I request something similar to :
    RequestHistory("ES #F", btDAYS, "100V", 1, -1, -1)

    For 90% of the bars I receive I it has 100 contracts per bar. But the other times I get a volume less than 100 .... anywhere from 1 to 99.

    I am handling the OnBarsChanged event as an update, almost line for line as the example in the documentation shows. So if I received a bar of 50V, and then receive the OnBarsChanged event, I update that bar ... I do not create a new bar.

    It appears that I am getting a OnBarsReceived event (new bar) before the OnBarsChanged event has completed the 100V existing bar.

    Any ideas? If I run the program after market hours it is perfect because no OnBarsChanged events are fired.

    Thanks

  • #2
    Any chance that the trade size of the next trade was significantly large enough to cause the need for a new bar without being able to fill the previous one to 100? If you reload the chart later, does it change?

    Cheers... George

    Comment


    • #3
      I will take a look at that but I just assumed that when I requested 40 contracts per bar it would never send a new bar until I received the full 40 bars for the current bar.

      I have come up with a workaround although it uses a lot more bandwidth. I ask for every trade "1T" and calculate the 40 bars (or whatever number I am using that day) in my application. Works like a charm but does use more bandwidth.

      Comment

      Working...
      X