sammchardy / python-kucoin

Kucoin REST and Websocket API python implementation
https://python-kucoin.readthedocs.io/en/latest/
MIT License
352 stars 148 forks source link

Lots of missing data from Kucoin #19

Closed Rob-bb closed 6 years ago

Rob-bb commented 6 years ago

I am getting a lot of None data from kucoin, some times for several minutes, is this a kucoin bug?

ts = time.time()

 kline = self.kucoin_client.get_kline_data_tv(self.pair_code, Client.RESOLUTION_1MINUTE, int(ts-60), int(ts))

data = {'t': kline[0], 'o': kline[1], 'c': kline[4], 'h': kline[2], 'l': kline[3], 's': self.pair_code}
print(data)`

gives a lot of this:

{'t': 1518064740, 'o': None, 'c': None, 'h': None, 'l': None, 's': 'BTC-USDT'}
{'t': 1518064800, 'o': None, 'c': None, 'h': None, 'l': None, 's': 'BTC-USDT'}
{'t': 1518064860, 'o': 8116.5, 'c': 8119.0, 'h': 8119.0, 'l': 8116.5, 's': 'BTC-USDT'}
{'t': 1518064920, 'o': None, 'c': None, 'h': None, 'l': None, 's': 'BTC-USDT'}
{'t': 1518064980, 'o': 8120.500006, 'c': 8119.1, 'h': 8125.0, 'l': 8119.1, 's': 'BTC-USDT'}
Rob-bb commented 6 years ago

Ok, I think the answer is that the empty data is when nothing it happening on KuCuion due to low volume of trades.

sammchardy commented 6 years ago

Yes I think you're right @Chingis-Khan you would need to filter out the None entries and take that as nothing changed on that pair.