kucoin-python-sdk icon indicating copy to clipboard operation
kucoin-python-sdk copied to clipboard

[Websocket] on minute close

Open AnimusXCASH opened this issue 2 years ago • 2 comments

Hi,

can someone assist me how to get the close value of klines through websocket?

thank you.

AnimusXCASH avatar Jan 15 '23 17:01 AnimusXCASH

Hello

When you subscribe to that topic, the response will look like this:

{ "type":"message", "topic":"/market/candles:BTC-USDT_1hour", "subject":"trade.candles.update", "data":{ "symbol":"BTC-USDT", // symbol "candles":[ "1589968800", // Start time of the candle cycle "9786.9", // open price "9740.8", // close price "9806.1", // high price "9732", // low price "27.45649579", // Transaction volume "268280.09830877" // Transaction amount ], "time":1589970010253893337 // now(us) } }

So in JSON response that you get, the third element in dic that you get would be the close price. In Python you can easily parse it by json.load()

progressivehed avatar Jan 16 '23 12:01 progressivehed

thank you.

AnimusXCASH avatar Jan 21 '23 06:01 AnimusXCASH

Since this issue has already been addressed, we will now close it. If you need any further assistance, feel free to ask!

ISAAC-XXYYZZ avatar Jul 29 '24 09:07 ISAAC-XXYYZZ