Announcement

Collapse
No announcement yet.

IsHistoryReady not working correctly

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

  • #31
    OnBarsReceived is called when backfill from the tic/history servers arrives.

    OnBarsChanged is called when a quote updates bar 0.

    Releasing the handles in one or both of those doesn't generally make sense, if you close it in OnBarsChanged for instance (which will start getting called right away, before even backfill comes, if the stock is active), then you won't (or shouldn't) be able to get any backfill for that handle. Prior to 7.5, doing this sort of thing would likely crash eSignal, I've added some smarter code to handle this since then.

    So, it's not really an issue of can or can you not do this, it's just that if it were a real application, it would be silly to do this.

    For the lExpectedHandle, it's again just a demonstration of what one ought to do in a real application, which is keep track (on your own) which handles correspond to which requests you've made. Though I've striven to stop this, one may still get events on handles that you've released, so you only want to deal with events that you are expecting. Likewise, if you tried to run two copies of your application, they will both get the events for each other's requests, another reason to only handle events on handles that you personally requested.

    As for the symbol stuff, you can request history updates on more than one symbol at a time, as long as you are careful about keeping track of what response is for what symbol etc. We have test applications that download history from 100+ symbols at the same time.

    As an aside, the reason your problem didn't get resolved until now is that your usage pattern is different (not better or worse) than what most users of the desktop API do. Generally, people get the maximum amount of data they can in one request and do stuff with it, rather than requesting 10, 20, 30, 40, 50 bars on the same symbol in sequence.

    That bug has been fixed, one should now reliably get an OnBarsReceived corresponding to each request made, even if that request didn't result in an actual query to the servers.

    Cheers,

    Simon.
    Simon Thornington
    eSignal Developer

    Comment


    • #32
      Simon,

      Great, thanks for clearification.

      Originally posted by sthornington

      That bug has been fixed, one should now reliably get an OnBarsReceived corresponding to each request made, even if that request didn't result in an actual query to the servers.
      Is there an ETA for this fix ?

      Regards
      Dierk Droth
      www.trademagic.net
      TradeMagic - Trading at its best

      Comment


      • #33
        Simon,

        When requesting Historical data in an application, it seems likely that for information (like getting today's open, or the previous day close like my application does), you may only want the bars once. I understand that you can filter the received events based on which handles you expect, however, given that with interop a thread is activated from the .NET thread pool for each event callback, it would be nicer (and likely much more efficient) to simply do a ReleaseHistory on the given handle once you were no longer interested in its bars.
        If the OnBarsReceived and/or OnBarsChanged events are not a good place to do this, where then would one insert such a call to achieve the result I have described?

        Please advise...

        - Kevin
        Kevin Anstey
        Paamco LLC

        Comment


        • #34
          Why not only request history for the bars that you want? This entire thread is about situations that should not really occur.

          Comment


          • #35
            Robi,

            I AM only requesting history for the symbols I want.
            However, when I request anything for today (such as opening price for a given symbol), I may receive repeated event strikes after I have already gotten what I require.

            Simon suggests that I filter the subsequent event strikes and ignore the ones that I don't want, which I can do, but if, as he suggests, I cannot (or should not) do a ReleaseHistory in either the OnBarsReceived and/or OnBarsChanged events, I would argue that it brings their usefulness into question.
            Using this model, I will receive the useful event the first time, for a given symbol, and then subsequently ignore 'hits' for the same symbol for as long as my application runs.

            This does not seem to me to be a viable solution.

            I am extremely busy, as I am sure you (and Simon) are. Please do not mistake this as a hypothetical discussion. This is a real production application that I am attepting to build, and these are, I believe, genuine issues that require your assistance.


            Thanks,

            Kevin
            Kevin Anstey
            Paamco LLC

            Comment


            • #36
              Robi,

              Sorry, but I have the feeling, that you still have not the right picture.

              There are valid scenarios where:
              a) the user requests the close of the previous and the open of the current day (and does this, by querying the history for the previous and current day) to e.g. polulate a market data display
              b) the user then decides to query the last 10 years of daily day to e.g. do some back testing

              I'm sure you do not want to suggest querying the last 10 years of data for only getting yesterday's close, do you ?

              Regards
              Dierk Droth
              www.trademagic.net
              TradeMagic - Trading at its best

              Comment


              • #37
                Not at all.

                After the initial request (2 bars of daily data) is completed (signified by the OnBarsReceived event), release the handle. Then ask for the second request. The problem is when asking for a second request before the first one is completely received.

                Comment


                • #38
                  Excellent.

                  That's the kind of information that I needed.

                  I again must commend you folks on the promptness of your replies. It is a pleasant change from the support offered by most software companies.


                  Regards,


                  -Kevin
                  Kevin Anstey
                  Paamco LLC

                  Comment

                  Working...
                  X