question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

what makes SubscribeToAllSymbolTickerAsync delayed?

See original GitHub issue

Am i doing something wrong?

in form aAllTickPriceTask = BCSocket.SubscribeToAllSymbolTickerAsync(Sub(bst) HandleStreamAllTickTimer(bst)) AllTickPriceTask = Await aAllTickPriceTask

sub `Private Async Sub HandleStreamAllTickTimer(bst As Binance.Net.Objects.BinanceStreamTick())

    For Each el In bst
        Try
            'Dim X = listaDeCandles.Find(Function(xx) xx.Par.ToUpper = el.Symbol.ToUpper And xx.TempoGrafico = "1h")
            'If Not X Is Nothing Then
            '    If X.ListaCandles.Last.closeprice <> el.CurrentDayClosePrice Then
            '        X.ListaCandles.Last.closeprice = el.CurrentDayClosePrice
            '    End If
            'End If
            If el.Symbol.Substring(el.Symbol.Length - 3) = "BTC" Or el.Symbol = "BTCUSDT" Then 'adicionei essa linha para poder ignorar o resto
                Dim y = listaPrecos.Find(Function(yy) yy.Par.ToUpper = el.Symbol.ToUpper)
                If Not y Is Nothing Then
                    If Not CDec(y.Price) = CDec(el.CurrentDayClosePrice) Then
                        If y.dtTick < el.EventTime Then
                            y.Price = el.CurrentDayClosePrice
                            y.dtTick = el.EventTime
                            y.Volume = el.TotalTradedQuoteAssetVolume
                        Else
                            System.Console.WriteLine(y.Par & " y.dtick " & y.dtTick & " > " & el.EventTime & " why ?")
                        End If
                    End If
                Else
                    Dim sMan As String = ""
                    Dim sAlt As String = ""
                    Select Case el.Symbol.Substring(el.Symbol.Length - 3)
                        Case "BTC"
                            sMan = "BTC"
                            sAlt = el.Symbol.Replace("BTC", "")
                        Case "BNB"
                            sMan = "BNB"
                            sAlt = el.Symbol.Replace("BNB", "")
                        Case "ETH"
                            sMan = "ETH"
                            sAlt = el.Symbol.Replace("ETH", "")
                        Case "SDT"
                            sMan = "USDT"
                            sAlt = el.Symbol.Replace("USDT", "")
                        Case "SDC"
                            sMan = "USDC"
                            sAlt = el.Symbol.Replace("USDC", "")
                        Case "PAX"
                            sMan = "PAX"
                            sAlt = el.Symbol.Replace("PAX", "")
                        Case "TUSD"
                            sMan = "TUSD"
                            sAlt = el.Symbol.Replace("TUSD", "")
                    End Select
                    Dim nPrice As New PTick(el.Symbol.ToUpper, sMan, sAlt, el.CurrentDayClosePrice, el.EventTime, el.TotalTradedQuoteAssetVolume)
                    listaPrecos.Add(nPrice)
                End If
            End If
        Catch ex As Exception
            System.Console.WriteLine( ex.Message)
        End Try
    Next
    Try
        Me.Invoke(Sub() lblPrecoUpdate.Text = bst(0).EventTime)
    Catch ex As Exception
    End Try
End Sub`

but after sometime, the price get delayed, how is the best way to store prices ? any tips? or better restart the task after sometime (there is anyway to do this)?

Thanks for you support.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nikkozpcommented, Mar 21, 2019

Hi, I don’t know much about VB, but I see a few comments

  1. Use ExchangeInfo there you can easily find a pair by BaseSymbol and QuoteSymbol

  2. Do not write a lot of code in the sockets, just add to the List. Then get the necessary information from another task or use delegates

0reactions
JKorfcommented, Apr 29, 2019

Closing, if you still need help with something let me know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found