I want to implement a websocket on this particular code because otherwise I am getting errors of too many requests in a minute. I can’t find a good example of someone using it (or just have other expectation of how the code would look like). Thanks in advance
def getCurrentPrice(symbol, timeFrame):
currentPrice = float(client.get_historical_klines(symbol=symbol, interval=timeFrame, start_str="1 m ago")[0][4])
return currentPrice
while (True):
currentPrice = getCurrentPrice("BTCUSDT", "1m")
print(currentPrice)
sleep(10)