Websocket Kline when is IsClosed true?

I have a subscription to the kline stream via websocket. I’ve set the polling interval to 1 second. The IsClosed flag is never true for any candle. I would expect as the closing time for the “current” candle passes that the IsClosed would be true and I’d get the final high/low/close price and volume data. But I’m left with an incomplete candle and the new candle starts streaming in.

How do I get the last update for the just completed candle?

Maybe you’re using a library?

Raw websocket stream events from Binance doesn’t have a isClosed field:

This is from the binance API page …

"x": false,     // Is this kline closed?

“e”: “kline”, // Event type
“E”: 123456789, // Event time
“s”: “BNBBTC”, // Symbol
“k”: {
“t”: 123400000, // Kline start time
“T”: 123460000, // Kline close time
“s”: “BNBBTC”, // Symbol
“i”: “1m”, // Interval
“f”: 100, // First trade ID
“L”: 200, // Last trade ID
“o”: “0.0010”, // Open price
“c”: “0.0020”, // Close price
“h”: “0.0025”, // High price
“l”: “0.0015”, // Low price
“v”: “1000”, // Base asset volume
“n”: 100, // Number of trades
“x”: false, // Is this kline closed?
“q”: “1.0000”, // Quote asset volume
“V”: “500”, // Taker buy base asset volume
“Q”: “0.500”, // Taker buy quote asset volume
“B”: “123456” // Ignore


What streams do you subscribe to?

I see correctly closed candlesticks on btcusdt@kline_1s every second, and for btcusdt@kline_1m there is a closed one produced at the end of every minute. The events with "x": false are updates to the current candlestick.



Candlestick closes at 1673599679999. An event about this is generated at 1673599680004. The next update is for the following candle which is still open.

For those playing along at home … I had a timer involved in the websocket and it seems I was just missing the closed candles. When I got 1s and 1 min candles I got the Closed flag correctly.
Thanks for those that tried to help.