issue with on_order_update

AAAAAAAAAA
AAAAAAAAAA edited June 25 in Python client
here is my function for on_order_update
kite_orders = []
kite_positions = []


def on_order_update(ws, data):
log_to_file_nopos(f"ON_ORDER_UPDATE_DATA >>> {data}") # appends postback data in a textfile.

while True:
try:
kite_orders.append(kite.orders()) # calls the api during the postback event
break
except:
log_to_file_nopos(f"orders error in on_order_update")
time.sleep(2)
pass
c = 0
while c <= 3:
try:
kite_positions.append(kite.positions()) # calls positions api the postback event. dont use it rn, will remove this soon.
break
except:
log_to_file_nopos(f"positions error in on_order_update")
time.sleep(2)
c += 1
pass


i wait till the postback of latest order has come to proceed with the accurate net calculation. it worked for all but one order today. for an order placed on 11:42 am, my log txt file never registered postback for that particular order and since my algo looks for the latest order_id before proceeding (i verify via kite.orders and kite.place_order), the order postback for that one order never got registered as per my txt log file as well as the algo itself.

however, that order postback is present in the kite_orders list i have created.

please also note that the txt log file also didnt log any errors in the on_order_update function.

how is that possible?
Sign In or Register to comment.