It looks like you're new here. If you want to get involved, click one of these buttons!
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
Is waiting for postback event then fetching orders always reliable?