I understand that there is a 24 hour price change statistics and i am trying to develop my app to 4 hour instead. I have read the docs provided by Binance at https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md and stackoverflow at How do Binance API calculate priceChangePercent in 24h but i couldn't get any clue. I have tried using client.get_historical_klines or client.get_klines but couldn't retrieve the result i want. I am lost here please if anybody can help would be much appreciated. Thanks !
def test1():
print(time.ctime())
try:
candles = client.get_historical_klines('BTCUSDT', Client.KLINE_INTERVAL_4HOUR, "19 Dec, 2019", "19 Dec, 2019" )
except BinanceAPIException as e:
print(e.status_code)
print(e.message)
return candles[0]
print(test1())