Hi All, I have been comparing prices from websocket !miniTicker@arr to real-time spot prices. After I connect to socket = wss://stream.binance.com:9443/ws/!miniTicker@arr, I realize prices are updated with a huge delay (sometimes in 20, 30 minutes) after the trades occur. This is a significant gap. How do I get closer to real-time price changes?
Should I frequently keep disconnecting and reconnecting the websocket?
Or, instead of miniTicker@arr, do I need to follow each individual ticker with symbol@trade ?
My simple python script is below:
def on_message(ws, m):
df=pd.read_json(m)
print(df)
def datastream():
websocket.enableTrace(False)
socket = f’wss://stream.binance.com:9443/ws/!miniTicker@arr’
ws = websocket.WebSocketApp(socket,on_message=on_message)
ws.run_forever()
datastream()