I was expecting to get order info in websocket on_order_update function but i'm not getting any value, on_ticks() works perfectly.. Any leads what I'm missing
def on_ticks(ws, ticks): if len(ticks) > 0: logging.info("Current mode: {}".format(ticks[0]["mode"])) for tick in ticks: print(tick)
# Callback for successful connection. def on_connect(ws, response): logging.info("Successfully connected. Response: {}".format(response)) ws.subscribe(tokens) ws.set_mode(ws.MODE_FULL, tokens) logging.info("Subscribe to tokens in Full mode: {}".format(tokens))
# Callback when current connection is closed. def on_close(ws, code, reason): logging.info("Connection closed: {code} - {reason}".format(code=code, reason=reason))
# Callback when connection closed with error. def on_error(ws, code, reason): logging.info("Connection error: {code} - {reason}".format(code=code, reason=reason))
# Callback when reconnect is on progress def on_reconnect(ws, attempts_count): logging.info("Reconnecting: {}".format(attempts_count))
# Callback when all reconnect failed (exhausted max retries) def on_noreconnect(ws): logging.info("Reconnect failed.")
1. Order updates are only sent when there is an update on the order, like partial fill, order modified. You won't receive order update when an order is just placed. 2. Don't block the main thread that has Websocket connection. If you make the thread sleep then it will get disconnected.
2. Don't block the main thread that has Websocket connection. If you make the thread sleep then it will get disconnected.