Announcement

Collapse
No announcement yet.

Handle Question

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

  • #16
    cj,

    I've been able to get independent streams and visually they "look ok". But have not yet compared that to what eSignal reports.

    The one thing have found is there can be a misordering of the streams, where the oldest history data gets overwritten with current day data. Simon reported he was able to reproduce this, but don't know if anyone looked into solving it yet.

    A check I did yesterday was add up total volume and also high/low information for each day. These came pretty close to what Yahoo reported for what symbols were checked. So it appeared there weren't big chunks of trade data missing at least..

    I am still working on my logic for all this and will repost if can thumbs up/down your question, but for right now can tell you not positive one way or other.

    -Jim

    Comment


    • #17
      Hi Robi,

      getting plenty of TSales data

      we are just trying to get everyting right with two stocks and then we want to pull 100

      if we do your code(TS.Sample.zip) - which runs one stock it comes in correct amount of data and in correct time sequence...

      to get more than one we built two arrays...
      if we do our code + arrays then the time sequence sometimes gets out of order and makes no sense and the more active stock dominates the data received... so if we use MSFT and GE we get lots of MSFT but hardly any GE and sometimes MSFT is out of sequence in terms of time...

      it's like the handles are jumping one another... or something

      are we missing the IsTimeSalesReady or something like it in the onTimeSalesChangedEvent area or ??

      cj
      sample in Access 2000 attached & also code below:


      ******************************************
      Option Compare Database
      Option Explicit

      Dim WithEvents esignal As IESignal.Hooks

      Dim lTsHandle(2) As Long
      Dim lLastTsRtCount As Long
      Dim ltHandle As Long

      Dim sLastSymbol As String
      Dim mySymbol As String
      Dim Symbols(2) As String


      Private Sub CreateHandles_Click()

      Dim tsFilter As IESignal.TimeSalesFilter, i As Integer

      Symbols(1) = "MSFT"
      Symbols(2) = "GE"

      Set esignal = New IESignal.Hooks
      esignal.SetApplication ("put login NAME HERE")

      If MsgBox("esig open", vbYesNo, "Ok or No") = vbNo Then
      Exit Sub
      End If

      esignal.ReleaseAllHistory
      esignal.ReleaseAllTimeSales
      esignal.ReleaseHistory (ltHandle)
      esignal.ReleaseTimeSales (ltHandle)

      ReleaseTS

      'assigning handles for the symbols in our ARRAY
      For i = 0 To 2
      If Symbols(i) <> "" And IsNull(Symbols(i)) = False Then
      esignal.DoSymbolLink Symbols(i)
      esignal.RequestSymbol Symbols(i), True
      tsFilter.sSymbol = Symbols(i)
      tsFilter.bQuotes = False
      tsFilter.bTrades = True
      tsFilter.lNumDays = 1
      tsFilter.bFilterPrice = False
      tsFilter.bFilterVolume = False
      tsFilter.bFilterQuoteExchanges = False
      tsFilter.bFilterTradeExchanges = False
      lTsHandle(i) = esignal.RequestTimeSales(tsFilter)
      ltHandle = lTsHandle(i)
      Debug.Print ltHandle & " - ltHandle"
      End If
      Next i

      End Sub


      Private Sub esignal_OnTimeSalesChanged(ByVal lHandle As Long)
      FillTS (lHandle)
      End Sub

      Private Sub FillTS(ByRef lHandle As Long)

      Dim bsSQL As String, lNumBars, lNumRtBars, lBar, lDiff As Long, sBar As String, i As Integer
      Dim item As IESignal.TimeSalesData, LastSize As Double, caseSize As Double, sSymbol As String
      Dim quote As IESignal.BasicQuote, myBid As Double, myAsk As Double, myPrice As Double

      For i = 0 To 2
      If lTsHandle(i) = lHandle Then
      sSymbol = Symbols(i)
      Exit For
      End If
      Next i

      'only showing realtime bars.
      lNumRtBars = esignal.GetNumTimeSalesRtBars(lHandle)
      lNumBars = esignal.GetNumTimeSalesBars(lHandle)

      'how many new bars since last time?
      lDiff = (lNumRtBars - lLastTsRtCount) * -1

      For lBar = lDiff + 1 To 0
      item = esignal.GetTimeSalesBar(lHandle, lBar)
      Select Case item.DataType
      Case 4 'tsdTRADE
      'do database stuff here
      bsSQL = "Insert Into tbl_All (TransTime, symbol, TransSize, Price, Flag) VALUES ('" & item.dtTime & "', '" & sSymbol & "'," & item.lSize & "," & item.dPrice & ", " & item.lFlags & ")"
      CurrentDb.Execute bsSQL, dbFailOnError
      Case tsdBID, tsdASK 'do nothing
      End Select
      Next lBar

      lLastTsRtCount = lNumRtBars

      End Sub



      Private Sub Form_Unload(Cancel As Integer)

      ReleaseTS
      Set esignal = Nothing

      End Sub



      Private Sub ReleaseTS()

      Dim i As Integer
      For i = 0 To 2
      If lTsHandle(i) <> 0 Then
      esignal.ReleaseTimeSales lTsHandle(i)
      End If
      Next i
      ltHandle = 0
      lLastTsRtCount = 0

      End Sub
      Attached Files
      **Have Stop - Will Trade**

      Comment


      • #18
        You are pretty brave to use MSFT and GE in a test program!

        If you are getting history it builds backward through time. So unless you wait until the history count stabilizes the data will change with the negative based indexing.

        There is a call Simon alerted me to called SetAbsoluteIndexing(1) which will let you use positive array indecies, thus the data will not shift. If you don't use this there are other caveats in some of my prior posts.

        I recommend setting it this way and seeing how things work.

        -Jim
        Last edited by JimBecker17; 08-23-2004, 04:18 PM.

        Comment


        • #19
          Jim,

          We are pulling REAL TIME & Sales data from the T&Sales server -

          If you are pulling history data you are pulling it from the History server...

          When we run our program it opens the esig Application - empties eSig of any old handles, creates new handles for n stocks and starts the T&Sales data pull from right at that moment...

          and the start time shows correctly in our dBase tables... in other words if we start at 9:10am - the first data is at that time and is correct as far as that goes... but from there on... not too good... i think i am not handling my handles right (sorry )...

          we are not having a problem with back fill or pre fill - but intermittant duplicate fill yes - if we do more than one stock the time sales data gets SLIGHTLY out of TIME sequence for 3 to 10 data inputs then runs up to the correct time and then after a while goes out of time sequence for 3 to 20 data inputs ...

          and also MSFT dominates the amount of inputs (100 to 1) since it is the more active of the two stocks...

          cj
          **Have Stop - Will Trade**

          Comment


          • #20
            I'm getting Tick data as well, but when you ask for 1 day of data you will get everything for the day, backfilling back to the earliest. So if there was something at 4:30AM you will get it as well.

            My RequestHistory() stuff is all different than this.

            What sounds like is happening is you start getting the 9:10 data, but then any earlier data gets filled in and you get messed up.

            This will showup also if you are processing the data and new historical comes in when you ARE NOT IN THE MESSAGE HANDLER CALLBACK. The sand will shift from under you within your loop.

            My suggestion on absolute indexing still applies.

            Personally I don't do anything with the data until the T&S history records haven't been incremented for a few minutes.. but i'm patient..

            -Jim

            Comment


            • #21
              Ok...

              Jim,

              thanks for driving the point home on using the SetAbsoluteIndexing(1) call

              i will try that first thing tomarrow...

              fingers way crossed...

              thanks...

              cj
              **Have Stop - Will Trade**

              Comment


              • #22
                Jim,

                1. tried esignal.esignal.SetAbsoluteIndexing(1) - no joy...
                we started the code at 7:30 am and it never went forward...

                2. Using same code as below without the indexing call we got the usual results of TS data being out of sequence and repeating.

                just to note:
                we can pull one stock in correctly for T&S into SQL Server ---
                even with 9000 data inputs like for MSFT in one hour we can pull in correct data and time sequence BUT we cannot even come close with two or more stocks...

                ANYBODY, using VB6
                can you pull in data for two or more stocks using the Real Time - Time and Sales data stream from the api that ALSO matches the esignal applications Time and Sales charts for those stocks one to one... can you reconcile it as accurate - one to one... does it MATCH!

                cj
                *****************************

                Option Compare Database
                Option Explicit

                Dim WithEvents esignal As IESignal.Hooks

                Dim lTsHandle(2) As Long
                Dim lLastTsRtCount As Long
                Dim ltHandle As Long

                Dim sLastSymbol As String
                Dim mySymbol As String
                Dim Symbols(2) As String


                Private Sub CreateHandles_Click()

                Dim tsFilter As IESignal.TimeSalesFilter, i As Integer

                Symbols(1) = "MSFT"
                Symbols(2) = "GE"

                Set esignal = New IESignal.Hooks
                esignal.SetApplication ("put login NAME HERE")

                If MsgBox("esig open", vbYesNo, "Ok or No") = vbNo Then
                Exit Sub
                End If

                esignal.ReleaseAllHistory
                esignal.ReleaseAllTimeSales
                esignal.ReleaseHistory (ltHandle)
                esignal.ReleaseTimeSales (ltHandle)

                esignal.SetAbsoluteIndexing(1)

                ReleaseTS

                'assigning handles for the symbols in our ARRAY
                For i = 0 To 2
                If Symbols(i) <> "" And IsNull(Symbols(i)) = False Then
                esignal.DoSymbolLink Symbols(i)
                esignal.RequestSymbol Symbols(i), True
                tsFilter.sSymbol = Symbols(i)
                tsFilter.bQuotes = False
                tsFilter.bTrades = True
                tsFilter.lNumDays = 1
                tsFilter.bFilterPrice = False
                tsFilter.bFilterVolume = False
                tsFilter.bFilterQuoteExchanges = False
                tsFilter.bFilterTradeExchanges = False
                lTsHandle(i) = esignal.RequestTimeSales(tsFilter)
                ltHandle = lTsHandle(i)
                Debug.Print ltHandle & " - ltHandle"
                End If
                Next i

                End Sub


                Private Sub esignal_OnTimeSalesChanged(ByVal lHandle As Long)
                FillTS (lHandle)
                End Sub

                Private Sub FillTS(ByRef lHandle As Long)

                Dim bsSQL As String, lNumBars, lNumRtBars, lBar, lDiff As Long, sBar As String, i As Integer
                Dim item As IESignal.TimeSalesData, LastSize As Double, caseSize As Double, sSymbol As String
                Dim quote As IESignal.BasicQuote, myBid As Double, myAsk As Double, myPrice As Double

                For i = 0 To 2
                If lTsHandle(i) = lHandle Then
                sSymbol = Symbols(i)
                Exit For
                End If
                Next i

                'only showing realtime bars.
                lNumRtBars = esignal.GetNumTimeSalesRtBars(lHandle)
                lNumBars = esignal.GetNumTimeSalesBars(lHandle)

                'how many new bars since last time?
                lDiff = (lNumRtBars - lLastTsRtCount) * -1

                For lBar = lDiff + 1 To 0
                item = esignal.GetTimeSalesBar(lHandle, lBar)
                Select Case item.DataType
                Case 4 'tsdTRADE
                'do database stuff here
                bsSQL = "Insert Into tbl_All (TransTime, symbol, TransSize, Price, Flag) VALUES ('" & item.dtTime & "', '" & sSymbol & "'," & item.lSize & "," & item.dPrice & ", " & item.lFlags & ")"
                CurrentDb.Execute bsSQL, dbFailOnError
                Case tsdBID, tsdASK 'do nothing
                End Select
                Next lBar

                lLastTsRtCount = lNumRtBars

                End Sub


                Private Sub Form_Unload(Cancel As Integer)
                ReleaseTS
                Set esignal = Nothing
                End Sub
                **Have Stop - Will Trade**

                Comment


                • #23
                  Chris,

                  Well you might be doing the correct thing.... I'm finding the data misorderings are more serious than expected, so who knows what the eSignal logic is doing.

                  It looks like trying to use the T&S data, particularly when one wants to put money on the result, will have to wait until these problems are corrected.. This is a major bummer.

                  From a small data sample, here is a snippet of what I'm seeing when just doing a date/time comparison on T&S consecutive records:


                  Update 'ANT' hist 3 min old.
                  Update ANT DHist 2998 Hist 3175 RT 177

                  Process First 0 Last 3175 nHist 3175
                  62: ANT 08/24/04 10:38:42 AM 33.50 3 Ask | NYSE | TrQAsk
                  63: ANT 08/24/04 10:22:20 AM 33.55 1 Bid | NYSE | TrQBid <<- Input Misorder
                  64: ANT 08/24/04 10:22:20 AM 33.56 6 Ask | PSE | TrQAsk
                  64: ANT 08/24/04 10:22:20 AM 33.56 6 Ask | PSE | TrQAsk
                  65: ANT 08/24/04 6:05:07 AM 0.01 1 Bid | PSE | TrQBid <<- Input Misorder
                  66: ANT 08/24/04 6:05:07 AM 132.08 1 Ask | THRD | TrQAsk
                  Update 'BG' hist 3 min old.
                  Update BG DHist 2141 Hist 2298 RT 157

                  Process First 0 Last 2298 nHist 2298
                  16: BG 08/24/04 10:38:28 AM 39.84 1 Bid | NYSE | TrQBid
                  17: BG 08/24/04 10:22:22 AM 39.87 15 Bid | NYSE | TrQBid <<- Input Misorder
                  18: BG 08/24/04 10:22:22 AM 39.89 22 Ask | NYSE | TrQAsk
                  19: BG 08/24/04 10:22:26 AM 39.87 18 Bid | NYSE | TrQBid
                  20: BG 08/24/04 6:05:14 AM 0.01 1 Bid | PSE | TrQBid <<- Input Misorder
                  21: BG 08/24/04 6:05:14 AM 118.22 1 Ask | THRD | TrQAsk
                  Update BG DHist 2141 Hist 2299 RT 158

                  Update 'BHP' hist 3 min old.
                  Update BHP DHist 2149 Hist 2235 RT 86

                  Process First 0 Last 2235 nHist 2235
                  1: BHP 08/24/04 10:22:39 AM 18.84 11 Ask | NYSE | TrQAsk
                  2: BHP 08/24/04 5:00:31 AM 19.10 3 Bid | PSE | TrQBid <<- Input Misorder
                  3: BHP 08/24/04 5:00:31 AM 58.24 1 Ask | THRD | TrQAsk
                  Update 'BLL' hist 3 min old.
                  Update BLL DHist 3099 Hist 3340 RT 241

                  Process First 0 Last 3340 nHist 3340
                  104: BLL 08/24/04 10:38:10 AM 37.36 200 Trade | THRD | TrInsd
                  105: BLL 08/24/04 10:22:19 AM 37.30 10 Bid | NYSE | TrQBid <<- Input Misorder
                  106: BLL 08/24/04 10:22:19 AM 37.31 2 Ask | NYSE | TrQAsk
                  108: BLL 08/24/04 10:22:20 AM 37.30 1300 Trade | NYSE | TrBid
                  109: BLL 08/24/04 6:18:08 AM 36.25 1 Bid | PSE | TrQBid <<- Input Misorder
                  110: BLL 08/24/04 6:18:08 AM 37.73 4 Ask | PSE | TrQAsk
                  Update 'BOH' hist 3 min old.
                  Update BOH DHist 2377 Hist 2609 RT 232

                  Process First 0 Last 2609 nHist 2609
                  89: BOH 08/24/04 10:38:52 AM 46.98 5 Bid | NYSE | TrQBid
                  90: BOH 08/24/04 10:22:18 AM 46.94 1 Bid | NYSE | TrQBid <<- Input Misorder
                  91: BOH 08/24/04 10:22:18 AM 46.95 8 Ask | NYSE | TrQAsk
                  94: BOH 08/24/04 10:22:46 AM 46.95 2 Ask | NYSE | TrQAsk
                  95: BOH 08/24/04 5:40:36 AM 45.84 21 Bid | PSE | TrQBid <<- Input Misorder
                  96: BOH 08/24/04 5:40:36 AM 47.74 21 Ask | PSE | TrQAsk
                  Update BOH DHist 2377 Hist 2610 RT 233

                  Update 'BOL' hist 3 min old.
                  Update BOL DHist 2738 Hist 2945 RT 207

                  Process First 0 Last 2945 nHist 2945
                  49: BOL 08/24/04 10:38:52 AM 65.43 3 Ask | NYSE | TrQAsk
                  50: BOL 08/24/04 10:22:32 AM 65.34 3 Bid | NYSE | TrQBid <<- Input Misorder
                  51: BOL 08/24/04 10:22:32 AM 65.37 17 Ask | NYSE | TrQAsk
                  54: BOL 08/24/04 10:22:45 AM 65.37 17 Ask | NYSE | TrQAsk
                  55: BOL 08/24/04 6:05:17 AM 0.01 1 Bid | PSE | TrQBid <<- Input Misorder
                  56: BOL 08/24/04 6:05:17 AM 67.67 1 Ask | PSE | TrQAsk
                  Update 'BSTE' hist 3 min old.
                  Update BSTE DHist 5777 Hist 6242 RT 465

                  Process First 0 Last 5000 nHist 6242
                  322: BSTE 08/24/04 10:38:51 AM 48.60 3 Bid | PSE | TrQBid
                  323: BSTE 08/24/04 10:22:35 AM 48.39 2 Bid | PSE | TrQBid <<- Input Misorder
                  324: BSTE 08/24/04 10:22:35 AM 48.44 4 Ask | PSE | TrQAsk
                  334: BSTE 08/24/04 10:22:43 AM 48.40 4 Bid | PSE | TrQBid
                  335: BSTE 08/24/04 4:30:00 AM 48.44 1 Bid | NMS | TrQBid <<- Input Misorder
                  336: BSTE 08/24/04 4:30:00 AM 48.71 1 Ask | NMS | TrQAsk
                  Update 'CCJ' hist 3 min old.
                  Update CCJ DHist 2346 Hist 2539 RT 193

                  Process First 0 Last 2539 nHist 2539
                  42: CCJ 08/24/04 10:38:48 AM 63.63 4 Ask | NYSE | TrQAsk
                  43: CCJ 08/24/04 10:22:16 AM 63.63 3 Bid | NYSE | TrQBid <<- Input Misorder
                  44: CCJ 08/24/04 10:22:16 AM 63.69 2 Ask | NYSE | TrQAsk
                  44: CCJ 08/24/04 10:22:16 AM 63.69 2 Ask | NYSE | TrQAsk
                  45: CCJ 08/24/04 6:05:23 AM 0.01 1 Bid | PSE | TrQBid <<- Input Misorder
                  46: CCJ 08/24/04 6:05:23 AM 195.54 1 Ask | THRD | TrQAsk
                  Update 'CHRW' hist 3 min old.
                  Update CHRW DHist 8700 Hist 9273 RT 573

                  Process First 0 Last 5000 nHist 9273
                  409: CHRW 08/24/04 10:38:43 AM 42.15 11 Bid | PSE | TrQBid
                  410: CHRW 08/24/04 4:30:01 AM 41.92 5 Bid | NMS | TrQBid <<- Input Misorder
                  411: CHRW 08/24/04 4:30:01 AM 42.04 4 Ask | NMS | TrQAsk
                  Update BSTE DHist 5777 Hist 6243 RT 466

                  Process First 5000 Last 6243 nHist 6243
                  Update 'COO' hist 3 min old.
                  Update COO DHist 2145 Hist 2394 RT 249

                  Process First 0 Last 2394 nHist 2394
                  75: COO 08/24/04 10:38:41 AM 57.77 1 Ask | NYSE | TrQAsk
                  76: COO 08/24/04 10:22:31 AM 57.75 1 Bid | NYSE | TrQBid <<- Input Misorder
                  77: COO 08/24/04 10:22:31 AM 57.82 1 Ask | PHIL | TrQAsk
                  78: COO 08/24/04 10:22:32 AM 57.82 1 Ask | NYSE | TrQAsk
                  79: COO 08/24/04 6:05:30 AM 0.01 1 Bid | PSE | TrQBid <<- Input Misorder
                  80: COO 08/24/04 6:05:30 AM 232.16 1 Ask | THRD | TrQAsk
                  Update 'EXBD' hist 3 min old.
                  Update EXBD DHist 3009 Hist 3225 RT 216

                  Process First 0 Last 3225 nHist 3225
                  99: EXBD 08/24/04 10:38:50 AM 59.00 100 Trade | PSE | TrAsk
                  100: EXBD 08/24/04 10:22:36 AM 58.94 1 Bid | NMS | TrQBid <<- Input Misorder
                  101: EXBD 08/24/04 10:22:36 AM 58.99 2 Ask | CSE | TrQAsk
                  104: EXBD 08/24/04 10:22:40 AM 58.94 100 Trade | CSE | TrBid
                  105: EXBD 08/24/04 4:30:02 AM 59.00 1 Bid | NMS | TrQBid <<- Input Misorder
                  106: EXBD 08/24/04 4:30:02 AM 59.15 1 Ask | NMS | TrQAsk
                  Update 'FDG' hist 3 min old.
                  Update FDG DHist 2028 Hist 2122 RT 94

                  Process First 0 Last 2122 nHist 2122
                  1: FDG 08/24/04 10:22:18 AM 45.40 2 Ask | NYSE | TrQAsk
                  2: FDG 08/24/04 5:21:51 AM 42.00 1 Bid | PSE | TrQBid <<- Input Misorder
                  3: FDG 08/24/04 5:21:51 AM 91.84 1 Ask | THRD | TrQAsk
                  Update 'FRK' hist 3 min old.
                  Update FRK DHist 6712 Hist 6837 RT 125

                  Process First 0 Last 5000 nHist 6837
                  19: FRK 08/24/04 10:38:40 AM 45.97 3 Bid | NYSE | TrQBid
                  20: FRK 08/23/04 5:06:03 AM 0.01 1 Bid | PSE | TrQBid <<- Input Misorder
                  21: FRK 08/23/04 5:06:03 AM 46.88 7 Ask | PSE | TrQAsk
                  4761: FRK 08/24/04 10:22:26 AM 45.92 100 Trade | THRD |
                  4762: FRK 08/24/04 6:05:55 AM 0.01 1 Bid | PSE | TrQBid <<- Input Misorder
                  4763: FRK 08/24/04 6:05:55 AM 142.06 1 Ask | THRD | TrQAsk
                  Update 'FTI' hist 3 min old.
                  Update FTI DHist 3822 Hist 4119 RT 297

                  Process First 0 Last 4119 nHist 4119
                  163: FTI 08/24/04 10:38:50 AM 29.84 6 Ask | NYSE | TrQAsk
                  164: FTI 08/24/04 6:05:55 AM 0.01 1 Bid | PSE | TrQBid <<- Input Misorder
                  165: FTI 08/24/04 6:05:55 AM 60.58 1 Ask | THRD | TrQAsk
                  Update FTI DHist 3822 Hist 4120 RT 298

                  Process First 0 Last 4120 nHist 4120
                  163: FTI 08/24/04 10:38:50 AM 29.84 6 Ask | NYSE | TrQAsk
                  164: FTI 08/24/04 6:05:55 AM 0.01 1 Bid | PSE | TrQBid <<- Input Misorder
                  165: FTI 08/24/04 6:05:55 AM 60.58 1 Ask | THRD | TrQAsk
                  609: FTI 08/24/04 10:22:22 AM 29.91 11 Ask | NYSE | TrQAsk
                  610: FTI 08/24/04 6:58:37 AM 30.00 1 Bid | NYSE | TrQBid <<- Input Misorder
                  611: FTI 08/24/04 6:58:37 AM 30.06 2 Ask | NYSE | TrQAsk
                  609: FTI 08/24/04 10:22:22 AM 29.91 11 Ask | NYSE | TrQAsk
                  610: FTI 08/24/04 6:58:37 AM 30.00 1 Bid | NYSE | TrQBid <<- Input Misorder
                  611: FTI 08/24/04 6:58:37 AM 30.06 2 Ask | NYSE | TrQAsk
                  Update 'GGC' hist 3 min old.
                  Update GGC DHist 46795 Hist 47007 RT 212

                  Process First 0 Last 5000 nHist 47007
                  191: GGC 08/24/04 10:38:15 AM 37.12 8 Bid | NYSE | TrQBid
                  192: GGC 08/11/04 5:10:31 AM 0.01 1 Bid | PSE | TrQBid <<- Input Misorder
                  193: GGC 08/11/04 5:10:31 AM 70.42 1 Ask | THRD | TrQAsk
                  Update CHRW DHist 8700 Hist 9273 RT 573

                  Process First 5000 Last 9273 nHist 9273
                  6918: CHRW 08/24/04 10:22:14 AM 42.08 5 Ask | AMEX | TrQAsk
                  6919: CHRW 08/24/04 9:13:59 AM 41.98 5 Bid | AMEX | TrQBid <<- Input Misorder
                  6920: CHRW 08/24/04 9:13:59 AM 42.00 3 Ask | CSE | TrQAsk
                  Update FRK DHist 6712 Hist 6838 RT 126

                  Process First 5000 Last 6838 nHist 6838
                  Update GGC DHist 46795 Hist 47008 RT 213

                  Process First 5000 Last 10000 nHist 47008
                  Update CHRW DHist 8700 Hist 9274 RT 574

                  Process First 5000 Last 9274 nHist 9274
                  6918: CHRW 08/24/04 10:22:14 AM 42.08 5 Ask | AMEX | TrQAsk
                  6919: CHRW 08/24/04 9:13:59 AM 41.98 5 Bid | AMEX | TrQBid <<- Input Misorder
                  6920: CHRW 08/24/04 9:13:59 AM 42.00 3 Ask | CSE | TrQAsk
                  Update GGC DHist 46795 Hist 47009 RT 214
                  Last edited by JimBecker17; 08-24-2004, 12:33 PM.

                  Comment


                  • #24
                    Jim,

                    thank for your diligence and responsiveness...

                    cj
                    **Have Stop - Will Trade**

                    Comment


                    • #25
                      JimBecker17,

                      I was finally able to look into this stuff. I can't find a problem. Each of the "Input Misorders" that you noted are Bid/Ask pairs and are identical to the "Time and Sales" window in eSignal. They occur at the exact same time, so I don't understand how they are out of order.

                      If you are worried about the actual timestamp, there is an option to toggle a "Synchronize to Computer Clock" on and off. We have found that some places have network time updates and we are essentially fighting for the right to set the clock. We are doing some additional work in the next few weeks to ensure that our times are sync'd to our network time, which is milliseconds (network latency) off of the atomic clock.

                      I may not have understood the problem exactly, but have been working with T&S issues for the past few weeks, but as far as I can tell, the data is coming in as expected. I am looking for an error in the API specifically, not in our T$S data. Please use the T&S window in eSignal to compare, since the data is coming from the same server, they should be identical.

                      Comment


                      • #26
                        chrisjames,

                        I did not look into your problem as much, but noticed that you have 2 symbols in a 3 symbol array (starting with 0). It looked like you may be matching incorrectly. I may have a chance to look into it deeper in the next few days.

                        Comment


                        • #27
                          Robi,

                          The "Input Misorder" line includes the entry prior and after in addition to where the error occurs. If you note the entry prior is always later in time than where the Input Misorder is noted. The entry after is ok.

                          The number on the left side is the index used to get the T&S data. Take a look at the sample code at bottom.

                          The data is not processed until it hasn't changed for about three minutes..

                          In this example note #62 is 16 minutes after #63. Same type thing with all the entries.


                          Process First 0 Last 3175 nHist 3175
                          62: ANT 08/24/04 10:38:42 AM 33.50 3 Ask | NYSE | TrQAsk
                          63: ANT 08/24/04 10:22:20 AM 33.55 1 Bid | NYSE | TrQBid <<- Input Misorder
                          64: ANT 08/24/04 10:22:20 AM 33.56 6 Ask | PSE | TrQAsk


                          sorry - can't figure out the tabs in this world..

                          lLastDate = 0;
                          lLastTime = 0;

                          for(i = nFirst; i < nLast; i++) {

                          ts = (TimeSalesData)((*m_piHooks)->GetGetTimeSalesBar(hData, i));

                          if( ts.dtTime == 0 ) // bad data.
                          continue;

                          ot = ts.dtTime;
                          lDate = (ot.GetYear() * 10000) + (ot.GetMonth() * 100) + ot.GetDay();
                          lTime = ot.GetHour() * 3600 + ot.GetMinute() * 60 + ot.GetSecond();

                          if( lDate < lLastDate || ((lDate == lLastDate) && (lTime < lLastTime)) ) {
                          ShowBar( pTC, i, 1, "Input Misorder" );
                          }
                          lLastDate = lDate;
                          lLastTime = lTime;
                          }


                          void CESignal::ShowBar( TDayCollection *pTC, int nBar, int nDelta, LPCSTR szText )
                          {
                          CString sBar, strLine;
                          int nFirst, nLast, nMax, nIndex;
                          TimeSalesData ts;

                          try {
                          nFirst = nBar - nDelta;
                          nLast = nBar + nDelta;
                          nMax = pTC->m_nHist;

                          if( nFirst < 0 )
                          nFirst = 0;
                          if( nLast > nMax )
                          nLast = nMax;

                          for( nIndex = nFirst; nIndex <= nLast; nIndex++ ) {

                          ts = (TimeSalesData)((*m_piHooks)->GetGetTimeSalesBar(pTC->m_hHist, nIndex));

                          sBar = FormatTSData(ts, pTC->m_strSymbol, nIndex);

                          if( nIndex == nBar ) {
                          strLine.Format("%s <<- %s\n", sBar, szText );
                          } else {
                          strLine.Format("%s\n", sBar );
                          }

                          ODBG(strLine);
                          }
                          }
                          catch (_com_error &e) {
                          COMErrorReset(e);
                          }
                          }

                          Comment


                          • #28
                            Originally posted by eSignal Robi
                            chrisjames,

                            I did not look into your problem as much, but noticed that you have 2 symbols in a 3 symbol array (starting with 0). It looked like you may be matching incorrectly. I may have a chance to look into it deeper in the next few days.
                            I was tweaking it so much i forgot to change the posted code to propertly reflect the arrray... even with them matching i cannot get it to work... out of sequence and repeating TS data even when you match correctly...

                            thanks Robi... hope you will have time to look into it soon...

                            cj
                            **Have Stop - Will Trade**

                            Comment


                            • #29
                              OK. I had a long talk with engineering about T&S. We are doing some changes to eSignal that deal with the timing of how data is displayed. I think that those changes will help alleviate the problem. What concerns me is more what some of you are attempting to use the API for. Some of it sounds very complicated and resource intensive and my concern is that it could be taxing the API pasts its limits. I personally think that in-depth number crunching on the E-mini T&S may be too much. Again, the relatively low cost of the API should be a sign that it may not work for everything. As I mentioned earlier, we are developing a much more robust API that will available to our retail customers. I expect that product to be ready for purchase in about 1-2 months. In the meanwhile, we are working on the timing of T&S within eSignal, which will be in a 7.8 Beta release. Simon has noted that there was another fix to T&S that was found to occur most apparently in the W2K environment, which may alleviate many of your problems. The next 2 updates of eSignal are working on your specific issues.

                              Comment


                              • #30
                                Thanks for continuing to press this issue, Robi.

                                I look forward to getting the correct data, if there is anything you would like me to help with in terms of testing 7.8 Alpha or other let me know.

                                If the data returned was correct and eSignal did not crash my only issue with the existing ActiveX approach would be speed related. There are some minor things which could be done on your side which would cure this problem in my opinion.

                                Using the filesystem would totally satisfy speed issues.

                                If the COM interface continues to be used for all T&S data, your developers might want to try converting the BSTR data of the sExchange in the T&S data to an enumerated type. I think if they timed moving data across the interface with and without BSTR data there would be a big improvement without any other changes.

                                I'm willing to help in any of this if the effort is desired.

                                -Jim

                                Comment

                                Working...
                                X