Hi, You will have to place a sell market order for the same instrument with same product to close long position and buy market order for the short position.
Hi @sujith, Thanks for the quick reply, If below is the order I placed for CO BUY INFY. What should be my order to square it order_id = kite.order_place(tradingsymbol="INFY",exchange="NSE",quantity=10,trigger_price=923,variety="co",transaction_type="BUY",order_type="MARKET",product="MIS",validity="DAY")
Hi, Yes, you just need to call that method. Let's say your first leg is already executed, for each second leg orders, there will be parent_order_id which points to the first leg order. You just need to pass that value which exiting bracket and cover orders.
Hi @sujith, I just placed above order to SELL(short) 10 INFY shares with variety CO. Please let me know, what is order_id and parent_order_id) that I should use for the below method.
You will have to place a sell market order for the same instrument with same product to close long position and buy market order for the short position.
Thanks for the quick reply, If below is the order I placed for CO BUY INFY.
What should be my order to square it
order_id = kite.order_place(tradingsymbol="INFY",exchange="NSE",quantity=10,trigger_price=923,variety="co",transaction_type="BUY",order_type="MARKET",product="MIS",validity="DAY")
To exit special order like bracket or cover order. Check out this example.
I am not a Java guy, is there a python equivalent please.
You just need to pass same parameters.
It just requires order_id, parent_order_id and variety.
I found this in python code, Is this the one I should be using? If so what is parent order Id?
Yes, you just need to call that method.
Let's say your first leg is already executed, for each second leg orders, there will be parent_order_id which points to the first leg order. You just need to pass that value which exiting bracket and cover orders.
I just placed above order to SELL(short) 10 INFY shares with variety CO. Please let me know, what is order_id and parent_order_id) that I should use for the below method.
order_cancel(self, order_id, variety="regular", parent_order_id=None):