0

I'm using websockets for stream. For example klines. But that's too much entry. If I retrieve the 1h kline, I just need open and close prices so there is no need to get the middle ones. How can I do that? If I need 4h kline, just need that at the close.

I'm using the "symbol@kline_interval" stream.

Gert
  • 3
  • 1

1 Answers1

0

To explain the kline stream:

  • A kline is valid for a specific minute. So in the first second of a new minute you get a kline with zero volume and and only the open price is sure for now.
  • On every change that happens to the kline, you will receive an update.
  • When the minute ends, you will receive the last kline for this minute, then also close price, volume and lowest/highest price are sure now.

Just be sure you got the last one:

if data['event_time'] >= data['kline']['kline_close_time']:

Best regards, Oliver

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Oliver
  • 105
  • 4