Sir,
I entered short sell order, with 2 buy orders. First is buy order as stoploss and second buy order as target.
While sl order is triggered, target order must be cancelled and vice versa.
But unable to cancel order.
I am coading in python.
Can you re-check, if you are sending correct variety and order_id?
"complete cancel_order, param"
We meant, you can know all input params required for cancel_order like variety, order_id and parent_order_id. Also, you can enable debug log and paste here your complete log for the required request made. Use the below code to enable debug logs:
Or use postback url to track everything and do it
order_id
to cancel required pending order. You can check complete cancel_order, param detail here. If you are looking to place a single order for both as One Cancels Other(OCO). You can try out two-leg GTT orders. Refer to the documentation here.if (sl_status == 'COMPLETE'):
send_rev_order_status = pd.DataFrame(kite.order_history(order_id=status['send_rev_order'])).iloc[-1]['status']
cancel_send_reverse_order = kite.cancel_order(variety = kite.VARIETY_REGULAR, order_id = status['send_rev_order'], parent_order_id=status['send_rev_order'])
# this will cancel stoploss order
if (send_rev_order_status == 'COMPLETE'):
sl_status = pd.DataFrame(kite.order_history(order_id=status['sl_order'])).iloc[-1]['status']
cancel_sl_order = kite.cancel_order(variety = kite.VARIETY_REGULAR, order_id = status['sl_order'], parent_order_id=status['sl_order'])
above is my code for cancel order.
Sir, i am unable to understand "complete cancel_order, param" pls give me example code if any.
Thank you
variety
andorder_id
? We meant, you can know all input params required for cancel_order like variety, order_id and parent_order_id.Also, you can enable debug log and paste here your complete log for the required request made. Use the below code to enable debug logs:
Is there any mail id? I want to send my code file.
Thank you
You need to give us the complete logs for helping you out.