question about on_order_update

AAAAAAAAAA
I have a function like this -


def on_order_update(ws, data):
log_to_file_nopos(f"ON_ORDER_UPDATE_DATA >>> {data}")
p = 0

while True:
p += 1
try:
kite_orders.append(kite.orders())
log_to_file_nopos(f"added details of order_id {kite_orders[-1][-1]['order_id']}")
log_to_file_nopos(f"value of p is {p}")
break
except:
log_to_file_nopos("orders error in on_order_update")
time.sleep(2)
pass
As per the docs on_order_update is automatically called when a status of an order changes. Therefore kite_orders list must also get updated with it. With this information I coded to use kite_orders elsewhere and waiting for 0.1 or 0.2 seconds for it to be updated under a while True break loop.

I have noticed that under this scenario, on_order_update never gets called. Orders are being placed, but neither my log book records any entry of the data from on_order_update not kite_orders gets appended.

I wish to use kite_orders to update my order_book and keep track of prices and total assuming it automatically gets updated, however its not happening right now. Please help.

@sujith @rakeshr

Thank you very much
Sign In or Register to comment.