bmoscon / cryptofeed

Cryptocurrency Exchange Websocket Data Feed Handler
Other
2.19k stars 679 forks source link

BinanceDelivery Candles (Rest) #897

Open christophlins opened 2 years ago

christophlins commented 2 years ago

General: Thank you First of all, I would like to convey my gratitude to you. You have created a fantastic library.

Describe the bug The candles method defined in the Binance Rest Mixin considers limits and adjusts the window by updating the start time (forward request). This works for Spot and UM. Unfortunately, the Binance API is not that consistent. For CM/Delivery, the approach is a backward request i.e. the end time requires to be updated i.e. end = data[0][0] - 1

To Reproduce Use BinanceDelivery and request a longer period which exceeds the limit=1000 such that multiple rest requests have to be triggered. Ideally, you can temporarily set the limit to 1 and send a request which expects two candles.

Expected behavior The data is sorted (ascending) covering data of the requested period.