Announcement

Collapse
No announcement yet.

getMostRecentBid / Ask

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

  • getMostRecentBid / Ask

    In the API, is there something similar to the EFS functions getMostRecentBid and getMostRecentAsk? I am retrieving data in real time and would occasionally like to reference bid and ask prices in addition to the standard OHLCV info.

    Thanks

  • #2
    drresser,

    The BarData data structure provides Bid and Ask data when the OnBarChanged Event is fired. The Bid/Ask should only update when the most current bar with Real -time is received.

    Comment


    • #3
      Thanks.
      Last edited by ddresser; 03-11-2011, 12:29 PM.

      Comment


      • #4
        Avery,

        I am having trouble receiving accurate bid/ask data. Is there any reason why one cannot ask for both Tick and 5 minute data at the same time? My code contains calls to

        h5 := RequestHistory[aSymbol, '5', btBars, aBars, -1, -1];
        and
        hT := RequestHistory[aSymbol, 'T', btBars, aBars, -1, -1];

        OnBarsChanged then calls
        newBar5 := eSignal.GetBar[h5, 0]; or
        newBarT := eSignal.GetBar[hT, 0];
        as appropriate.

        The resulting newBarT does not contain accurate bid, ask or trade prices. The time, OI and flag fields look ok. OHLCV fields are all zero, both when the flag is 1 (bid / ask) and when it is 2 (trade).

        The newBar5 fields look ok.

        Thanks,
        Don
        Last edited by ddresser; 03-11-2011, 04:49 PM.

        Comment


        • #5
          Following up on the prior post, here is a log of data received for symbol RF for a few seconds this afternoon. The designation Save means the current bar was captured on a timed basis, for an interval set to either the 5 minute or Tick basis, and Chng means that the OnChange method was called, again with the interval either "5" or "T".

          As you can see, the bid, ask and trade fields are printing bad data. Everything else seems to be ok.

          12:50:21 PM Save 5 RF T=0.5391 O=7.280 H=7.280 L=7.280 C=7.280 V=566 oi=0.0 f=0 b=0.000 a=0.000 t=0.000
          12:50:21 PM Save T RF T=0.5349 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=1 b=4.27698E086 a=-4.310086E012 t=4.276981E086
          12:50:21 PM Chng T RF T=0.5350 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=2 b=0.000 a=0.000 t=4.27698E086
          12:50:21 PM Chng T RF T=0.5350 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=2 b=0.000 a=0.000 t=4.27698E086
          12:50:21 PM Chng 5 RF T=0.5347 O=7.280 H=7.280 L=7.280 C=7.280 V=666 oi=0.0 f=0 b=0.000 a=0.000 t=0.000
          12:50:23 PM Chng T RF T=0.5350 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=2 b=0.000 a=0.000 t=0.000
          12:50:23 PM Chng 5 RF T=0.5347 O=7.280 H=7.281 L=7.280 C=7.281 V=766 oi=0.0 f=0 b=0.000 a=0.000 t=0.000
          12:50:23 PM Chng T RF T=0.5350 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=1 b=4.27698E086 a=-4.310086E012 t=0.000
          12:50:24 PM Chng T RF T=0.5350 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=1 b=4.27698E086 a=-4.310086E012 t=0.000
          12:50:27 PM Chng T RF T=0.5350 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=2 b=0.000 a=0.000 t=4.27698E086
          12:50:27 PM Chng 5 RF T=0.5347 O=7.280 H=7.281 L=7.280 C=7.280 V=866 oi=0.0 f=0 b=0.000 a=0.000 t=0.000
          12:50:27 PM Chng T RF T=0.5350 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=1 b=4.27698E086 a=-4.310086E012 t=4.276981E086
          12:50:28 PM Chng T RF T=0.5350 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=1 b=4.27698E086 a=-4.310086E012 t=4.276981E086
          12:50:31 PM Chng T RF T=0.5351 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=2 b=0.000 a=0.000 t=4.27698E086
          12:50:31 PM Chng T RF T=0.5351 O=0.000 H=0.000 L=0.000 C=0.000 V=0 oi=0.0 f=2 b=0.000 a=0.000 t=4.27698E086

          Any ideas on why the bad data is coming through?

          Thanks,
          Don

          Comment


          • #6
            I have discovered why the tick bid, ask and trade numbers reported earlier are coming in wrong, and will post the details in a new thread.

            Comment

            Working...
            X