Fetching change in orderStatus

I am trying to fetch the orderStatus with an infinite loop until the stop limit order is traded. however it never returns ‘TRADED’ status even when actually traded. Can you spot the issue.

status_flag = 0
while True:
if status_flag == 0:
order_status = buy_op_id[‘data’][‘orderStatus’]
print(order_status)
if order_status == ‘TRADED’:
print(order_status)
sell_op_id = place_Sell(security_id_1, price2, trigger_price2, quantity1)
status_flag = 1
if status_flag == 1:
break

Hello @Dev

Sure, will take a look.

Can you share your Client ID along with Order ID and Date over DM if possible? Will have to check API status at our end to debug this.