filtering of valid klines through socket stream

Hello, I’m wondering if there is some rule to follows, in order to exclude some received klines when processing result of websocket stream market data.

For instance, I’ve encountered an example I hardly manage to reproduce, but I received this quote :

It was an answer to subscribtion of ethusdt@kline_1m


You can see the fields First and Last trade ID have value -1
and q V Q at zero.

Unfortunately, I don’t have previous quote, but the o c h l values looked suspicious too (they are all the same).

My question is, what this quote means ? Should I exclude some base on simple rules (like negative values for f or L ?)

Thanks !

This kline means there were no trades during the interval.

It can happen during low-volume periods. Most often for low-volume trading pairs, but occasionally with ETH & BTC as well.

That’s why the OHLC prices stay the same: it’s the last traded price, i.e. closing price of a previous kline with at least one trade. That’s also why volume values are all zeros too.

If you would like to filter out events like this, using "n": 0 is easier (that’s the number of trades).

1 Like

Thanks for your expanation.
I would have another confirmation to ask you, just to be sure, about how it works :

if I subscribe to a 1m stream, I will always receive some kline with status “x”: true which mean closed, when it switch from one 1m kline to the next.

If I wand to rebuild a 1m kline from these data, I can take the open time and open price from the first kline following a closed kline, the close time and close price of next closed kline, then compute the min and max for high and low values from klines received between these limit ?

Thanks !

One last question and I stop :hugs:
Do you have any plan or ticket about SBE kline websocket stream feature ?