Announcement

Collapse
No announcement yet.

Quote data error during pre-market

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

  • Quote data error during pre-market

    HELP!

    I am having a problem getting live trade data during pre-market hours for SPY (Spiders) when using the GetBasicQuote API call. What I see is that the BID and ASK prices are correct as the quote records come in, but the LAST price is actually the previously day's close, and NOT the most recent trade price. Once SPY actually opens (after 9:30 AM EST), then the LAST price really is returning the latest trade price, as one would expect.

    Example from this morning (2006/10/19):

    TIME______: 09:29:35 AM
    LAST______: 136.59
    BID_______: 136.38
    ASK_______: 136.41
    LASTSIZE__: 500
    BIDSIZE___: 374
    ASKSIZE___: 145

    As you can see, the LAST price is 136.59, which is actually the close for 2006/10/18. After looking at Time&Sales for SPY, I can see that it actually traded those 500 shares at 136.38, which is the BID side.

    After the market opens, I now see that the LAST value is truly reflecting that most recently trades price:

    TIME______: 09:30:01 AM
    LAST______: 136.39
    BID_______: 136.40
    ASK_______: 136.41
    LASTSIZE__: 500
    BIDSIZE___: 10
    ASKSIZE___: 622

    Why does eSignal have this behavior?

    Is there a way to have the API return the correct LAST price via the GetBasicQuote function during pre-market hours (via configuration, etc.)?

    Any help is appreciated!!

    Mikey

  • #2
    Hi Mikey,

    I'll take a look at this during premarket hours on Monday. I wanted to clarify something though... when you say

    "After looking at Time&Sales for SPY, I can see that it actually traded those 500 shares at 136.38,"

    Are you referring to the Time & Sales window in eSignal? Also, can you click File, Preferences, Premarket tab, and let me know what you have selected there?

    Thanks,
    Starr
    eSignal Developer Support

    Comment


    • #3
      Starr,

      Thanks for looking into this.

      Regarding the 500 shares... I had to look at the Time & Sales window in eSignal in order to see the trade price, because the API was only giving me the previous day's close price (until the market actually opened).

      I'm running eSignal version 7.5 as well as 7.9 (I have multiple licenses), so I don't have a Premarket tab in the File->Preferences window on my 7.5 version...

      On the 7.9 version, it is set to the first option ("Never blank fields"). I'm not sure I understand these options, but for SPY, there is premarket activity every day, so I would expect the 'last' field to change frequently....

      If there is a solution for both versions of eSignal, that would be great. Otherwise, I'll take any partial solution you have.

      Regards,
      Mikey

      Comment


      • #4
        Good Morning,

        I was able to see the same thing this morning pre-market, and subsequently did some research. This is actually by design. You'll notice that in the eSignal Quote window (which gets data from the DMs in our farm, just as getBasicQuote does) the last also doesn't update there. As you've seen, it does update in the Time & Sales window.

        So, in your application, I would recommend using a Time & Sales request instead of getBasicQuote. I've included sample code below. Full documentation on Time & Sales requests begins on page 4-7 of the Desktop API documentation.

        Starr


        Dim tsFilter As IESignal.TimeSalesFilter
        tsFilter.sSymbol = "SPY"
        tsFilter.bQuotes = True
        tsFilter.bTrades = True
        tsFilter.lNumDays = 2
        tsFilter.bFilterPrice = False
        tsFilter.bFilterVolume = False
        tsFilter.bFilterQuoteExchanges = False
        tsFilter.bFilterTradeExchanges = False

        requestHandle = esignal.RequestTimeSales(tsFilter)


        Private Sub esignal_OnTimeSalesChanged(ByVal tsHandle As Long)

        If requestHandle = tsHandle Then

        Dim lNumBars, lNumRtBars, lBar, lDiff As Long
        Dim item As IESignal.TimeSalesData

        lNumRtBars = esignal.GetNumTimeSalesRtBars(tsHandle)

        lNumBars = esignal.GetNumTimeSalesBars(tsHandle)

        lDiff = (lNumRtBars - lLastTsRtCount) * -1

        For lBar = lDiff + 1 To 0
        item = esignal.GetTimeSalesBar(tsHandle, lBar)

        If item.DataType = tsdBID Then
        sBar = Format$(item.dtTime) & vbTab & Format$(item.dPrice) & " (Bid)" & vbTab & Format$(item.sExchange)
        ElseIf item.DataType = tsdASK Then
        sBar = Format$(item.dtTime) & vbTab & Format$(item.dPrice) & " (Ask)" & vbTab & Format$(item.sExchange)
        Else
        sBar = Format$(item.dtTime) & vbTab & Format$(item.dPrice) & vbTab & vbTab & Format$(item.sExchange)
        End If

        List1.AddItem sBar, 0
        Next lBar

        lLastTsRtCount = lNumRtBars

        End If

        End Sub

        Comment


        • #5
          Starr,

          Thanks for the detailed response.

          Question: what is the purpose of having the Quote mechanism operate this way?

          Also: Doesn't setting the Premarket tab preference to the third option ("Blank fields until premarket display") resolve my issue? If not, then what are these Premarket options used for?

          I ask these questions as I have relied on using the Quote mechanism in my code, and changing over to Time & Sales will present a resource drain.

          Thanks,
          Mikey

          Comment


          • #6
            Hello again,

            The Desktop API makes its requests through the eSignal application. GetBasicQuote is the same type of request that the eSignal Quote Window makes and you will see that the same behavior occurs there. The Last column does not update until the market opens. The Time & Sales window, on the other hand, does provide these updates.

            The Premarket settings are relatively new and the API does not take advantage of them.

            Comment

            Working...
            X