what makes SubscribeToAllSymbolTickerAsync delayed?
See original GitHub issueAm 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:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I don’t know much about
VB
, but I see a few commentsUse
ExchangeInfo
there you can easily find a pair byBaseSymbol
andQuoteSymbol
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
Closing, if you still need help with something let me know.