Closed austymenko closed 2 weeks ago
ticket_stream
📝 It's ticker_stream, not ticket_stream
https://bybit-exchange.github.io/docs/v5/websocket/public/ticker
@austymenko
The function is already available.
Here is an example of use.
@hirokisan yeah, ticker_stream
, my typo. In this example only one symbol SymbolV5BTCUSDT
is used. Do you have example of the ticker_stream
to listen for multiple symbols?
@austymenko
listen for multiple symbols
I understand what you are saying.
Now it supports a single Ticker in the form of a SubscribeTicker, but not multiple Tickers.
For example, it could be implemented this way.
yourFunc := func(response V5WebsocketPublicTickerResponse) error {
assert.Equal(t, respBody["topic"], response.Topic)
testhelper.Compare(t, respBody["data"], response.Data.LinearInverse)
return nil
}
symbols := []SymbolV5{SymbolV5BTCUSDT, SymbolV5ETHUSDT}
for _, symbol := range symbols {
_, err := svc.SubscribeTicker(
V5WebsocketPublicTickerParamKey{
Symbol: symbol,
},
yourFunc,
)
require.NoError(t, err)
}
@hirokisan thank you!, I will try.
Hello, can somebody suggest how (if) possible to subscribe to ticket_stream with the list of symbols as it's done in Pybit ?