Announcement

Collapse
No announcement yet.

Duplicate T&S Txns??

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

  • Duplicate T&S Txns??

    In VB .Net in esignal_OnTimeSalesChanged event I process real-time trades by looking at the last tick with esignal.gettimesalesbar(lhandle, 0) as used in the sample code. I am using the filter in the sample code by default, ie, allowing trades and quotes and use the timesalesdataflag (value 4) to hone in on the trades only.

    Occassionally this returns a duplicate trade usually when there is a fresh burst of trades - any views why this might be happening? Is there something that I am missing here?

  • #2
    I have not heard of this. Do you see duplicate trades in the Time and Sales window of eSignal as well?

    Comment


    • #3
      Also, what are your parameters for determining if it is a duplicate trade? It's quite possible for a trade to have the same size, price, timestamp (to the second), and trade exchange as others in a row.

      Comment


      • #4
        Good points:

        Robbi, I'll check esignal and let you know.
        Dion, I'm running integrity checks against live trade streams from Moneyam in uk and you are right , moneyam may be dropping genuine identical trades. However, I am not convinced that I have not got a bug at this stage. I'll keep you posted.

        Thanks

        Comment


        • #5
          Further Info:

          I should have said also that what makes me suspicious is that these "suspected" duplicates are always adjacent and are highly coincident with bursts. It could be another bug in VB of course but in this case I'm not suspecting it.

          The comparison with money am stream has got me thinking as it has also led me to examine timesales(data)flags settings which are also giving rise to differences.

          The dup txn is the one I'd like to sort as generally this api is doing the biz for me.

          Comment


          • #6
            Silly question, but are you checking the time and sales flag and only displaying info for a tsdTrade? I have seen similar behaviour to what you are describing in other code, and that was the problem. Bid and ask changes come in bursts between actual trades, so depending on how you are storing and displaying the data, you might just be seeing that.

            Cheers... George

            Comment


            • #7
              I wish it was that easy - my code tests for timesalesdataflag being equal to 4. I do have quotes set to true on filter but this should n't affect my if statement further down the line unless, of course, a quote can come through with a timesalesdataflag of 4?

              Comment


              • #8
                It is a long shot, but I would be curious to know if you see the same behaviour if you turn off quotes in the time and sales filter. Just trying to narrow down possible causes.

                Cheers... George

                Comment


                • #9
                  Robbi,

                  The duplicates do not show in esignal - any ideas?
                  Switch quotes off from the filter and I get complete mess - most sales are missed and those that do come thru are in triplicate or more!

                  i am getting worried.

                  Regards,

                  Neil
                  Last edited by neilcavanagh; 03-14-2005, 01:53 AM.

                  Comment


                  • #10
                    Is there anyway you could share the source code for the project? I watch time and sales for minis all the time (via the Desktop API) and never have issues with duplicates. It would be nice to be able to run your app so we can duplicate the exact same circumstances (same symbols, same code, etc).

                    Cheers... George
                    Last edited by GenSpoo; 03-14-2005, 07:44 AM.

                    Comment


                    • #11
                      Heres the filter code (use barc-lon say as the symbol):

                      Private Sub GetTimeSalesButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GetTimeSalesButton.Click
                      If esignal.IsEntitled <> 1 Then
                      MessageBox.Show("IsEntitled returned false. Can't send request.")
                      StatusLabel.Text = "Not Entitled"
                      Return
                      End If

                      If SymbolTextBox.Text.Length > 0 Then
                      Dim filter As IESignal.TimeSalesFilter

                      If tsHandle <> -1 Then
                      esignal.ReleaseTimeSales(tsHandle)
                      End If

                      filter = New IESignal.TimeSalesFilter
                      filter.bFilterPrice = 0
                      filter.bFilterQuoteExchanges = 0
                      filter.bFilterTradeExchanges = 0
                      filter.bFilterVolume = 0
                      filter.bQuotes = 1
                      filter.bTrades = 1
                      filter.lNumDays = 1
                      filter.sSymbol = SymbolTextBox.Text
                      tsHandle = esignal.RequestTimeSales(filter)

                      If esignal.IsTimeSalesReady(tsHandle) Then
                      ' Data already in cache, won't receive event until next "live" tick
                      StatusLabel.Text = "History Complete"
                      Else
                      StatusLabel.Text = "Request Sent"
                      End If
                      End If
                      End Sub


                      and heres the on change code :

                      Private Sub esignal_OnTimeSalesChanged(ByVal lHandle As Integer) Handles esignal.OnTimeSalesChanged

                      If lHandle = tsHandle Then
                      If esignal.IsTimeSalesReady(lHandle) Then
                      StatusLabel.Text = "History Complete"
                      Else
                      StatusLabel.Text = "Receiving Data"
                      End If
                      Dim tick As IESignal.TimeSalesData
                      tick = esignal.GetTimeSalesBar(lHandle, 0)
                      If tick.DataType = 4 Then
                      strBuySell = "UNKNOWN"
                      If tick.dPrice > globals.midprice Then
                      strBuySell = "BUY"
                      End If
                      If tick.dPrice < globals.midprice Then
                      strBuySell = "SELL"
                      End If
                      ListBox1.Items.Insert(0, Str$(tick.dtTime.Hour) & ":" & Str$(tick.dtTime.Minute) & ":" & _
                      Str$(tick.dtTime.Second) & " Price:" & Str$(tick.dPrice) & strBuySell & " Size:" & Str$(tick.lSize) _
                      & " type: " & Str$(tick.DataType) & " flag: " & Str$(tick.lFlags))
                      End If
                      End If
                      End Sub

                      Thanks George

                      Comment


                      • #12
                        The first thing I notice is that you aren't tracking the count of the ticks, so you can't say 100% for sure that you aren't reporting the same tick more than once, or skipping ticks.

                        I'd add some code to call GetNumTimeSalesBars and GetNumTimeSalesRtBars into your event handler and see what happens.

                        Cheers... George

                        Comment

                        Working...
                        X