sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
5.91k stars 2.19k forks source link

If startTime and endTime are not sent, the most recent klines are returned. #1280

Open KaosHacker opened 1 year ago

KaosHacker commented 1 year ago

hi friends, when pulling data from python, the last bar is repeated, I am doing a live operation, what I mean by the last bar repeat is that when I constantly pull new bars, the close value sometimes appears twice because of this error, does anyone have an idea where I am doing wrong?

close 20895.299999999996 close 20890.300000000003 close 20890.300000000003 close 20883.750000000007 2023-01-20_01h11_56 2023-01-20_01h10_00

KaosHacker commented 1 year ago

still on

halfelf commented 1 year ago

I believe this is expected. Since you haven't shown us all the codes, I cannot know how frequently getData() is called, and my suggestion is to filter repeated data by exchange timestamp, set a timer to call getData() regularly, or use websocket API.