I am using Python and with this code managed to continuously get price data via the Websocket:
import websocket
import json
SOCKET = "wss://stream.binance.us:9443/ws/btcusdt@bookTicker"
def on_open(ws):
print("opened connection to Binance streams")
def on_close(ws):
print("closed connection to Binance streams")
def on_message(ws, message):
print("message received from Binance streams")
json_message = json.loads(message)
b = json_message['b']
a = json_message['a']
print(a,b)
ws = websocket.WebSocketApp(SOCKET, on_open=on_open, on_close=on_close,
on_message=on_message)
ws.run_forever()
Now I’m wondering if there is a way to continuously get an order status via the Websocket. The order is on Futures trading, and I know its orderId.
Can this be done by simply changing the link at " SOCKET = … " or is the process more complicated. Is it even possible at all?
Thanks in advance!