Closed sandroboehme closed 5 years ago
It's actually most of the time that the ohlc data has the same value.
Any hints about why this might happen is highly appreciated!
@sandroboehme
Because we are using a rest API, the exchange is constantly polled for new data at the exchanges rate limit. It will attempt this every few seconds.
So yes, it is a little wasteful but trying to doe it once per minute (or whatever timeframe you are using) is a little problematic. First of all, you would need to sychronize to the minute, hour or whatever depending on the timeframe. Next, the exchanges tend not to update their Rest API right on the second. For example, a new bar might only be returned from the API 4-5 seconds after the bar has closed.
Using the exchanges Websocket API would be the resolution for this.
Let me know if I missed the point!
Closing for housekeeping as there has not been a response for a while. Please re-open it if needed!
When I set a conditional breakpoint in
binance.py:fetch_ohlcv()
afterpublicGetKlines()
I can inspect the variables for this scenario but it's still not clear to me where that comes from. The breakpoint condition I use is:len(response) == 2 and response[1][1] == response[1][2] and response[1][2] == response[1][3] and response[1][3] == response[1][4]
To make the gist work the code from the #5 pull request needs to be used to avoid needing a Binance API key.