Announcement

Collapse
No announcement yet.

Synchronous GetBasicQuote

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

  • Synchronous GetBasicQuote

    First I request a symbol, asking for one realtime quote. Then I follow that up immediately with a call to GetBasicQuote.

    If the symbol is being tracked (i.e., has had a realtime request previously) then the object fills immediately, presumably with the directly previous value. If it's not, I get zeroes for a short time before the object gets the correct values.

    This call to GetBasicQuote returns immediately in either case. Is there any way to make it synchronous, i.e., block the thread until the values are updated? If this scenario is analogous to history and time/sales retrieval, is there some IsQuoteReady equivalent I've missed? Thanks.

  • #2
    Re: Synchronous GetBasicQuote

    Originally posted by pcxtmarkm
    If this scenario is analogous to history and time/sales retrieval, is there some IsQuoteReady equivalent I've missed?
    Take a look at OnQuoteChanged.

    Cheers... George

    Comment


    • #3
      I am currently using OnQuoteChanged to monitor realtime updates for symbols that have been requested. This represents an entirely different methodology than what I am trying to do, however.

      What I would like to do is what the documentation calls providing "one real-time quote for the given symbol". This suggests to me that the quote should have the appearance of immediate retrieval. It seems that the functionality I am expecting is intended. I ask for a realtime quote once, and then retrieve the quote. However, this is less than useful if I cannot guarantee that GetBasicQuote will do, indeed, just that.

      I think I see what you are saying, though. Even if I only retrieve one quote, I still have to wait for an event to ensure that the quote is ready for retrieval. If that's the case, it seems like a very cumbersome process applied to a simple problem. Why not encapsulate this event in GetBasicQuote, and when I call it, I can specify I'm willing to wait, rather than losing control of the procedure to an event which isn't even aware of the difference between the two different ways I'm trying to process quotes?

      In other words, the necessity of the event handler for getting a single quote (which is really only taking a fraction of a second to fill) is too great for truly on-demand retrieval.

      Comment

      Working...
      X