'"client.get_historical_klines" from Binance API doesn't return good value
Using the function below gives me this result:
[1637971200000, '53756.29000000', '53859.31000000', '53747.77000000', '53853.57000000', '16.49892000', 1637971259999, '887949.68081540', 639, '12.00163000', '645905.65329110', '0']
client.get_historical_klines("BTCBUSD", Client.KLINE_INTERVAL_1MINUTE, "27 Nov, 2021 00:00:00","27 Nov, 2021 00:00:59")
If I compare with the graph at the same date, candle doesn't match.
Where did I go wrong? Thanks
Solution 1:[1]
It is because you are looking at the wrong candle. Your picture reveals that you are in UTC+1, so you have to look at 01:00 to see the correct handle
Solution 2:[2]
Try to set testnet
to False in binance.Client(api_key, secret_key, testnet)
Solution 3:[3]
frame = pd.DataFrame(client.get_historical_klines(symbol, interval, lookback + " day ago UTC"))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Tugay |
Solution 2 | MsSnakONE |
Solution 3 | Asraful Islam Spondon |