Viald
Viald

Reputation: 37

"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.

BTCBUSD Graph

Where did I go wrong? Thanks

Upvotes: 1

Views: 6670

Answers (3)

Asraful Islam Spondon
Asraful Islam Spondon

Reputation: 49

frame = pd.DataFrame(client.get_historical_klines(symbol, interval, lookback + " day ago UTC"))

Upvotes: 0

MsSnakONE
MsSnakONE

Reputation: 1

Try to set testnet to False in binance.Client(api_key, secret_key, testnet)

Upvotes: 0

Tugay
Tugay

Reputation: 2214

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

Upvotes: 2

Related Questions