When I place a buy BO order and the order is executed, can I exit the order by calling order_cancel() passing the parent_order_id and variety as 'bo'. When I mean exit, I want to square off the target order at that moment.
@gkannan1965 You will get the parent order_id from orders() call but ideally it should also be on individual order call, will be fixed in next version.
I am unable to cancel BO order. The error msg is as below: print (kite.order_cancel('160607000057123', variety='bo', parent_order_id='1 60607000057122')) File "D:\Kan\API_Test\kiteconnect\__init__.py", line 309, in order_cancel "parent_order_id": parent_order_id File "D:\Kan\API_Test\kiteconnect\__init__.py", line 447, in _delete return self._request(route, "DELETE", params) File "D:\Kan\API_Test\kiteconnect\__init__.py", line 521, in _request raise(exp(data["message"], code=r.status_code)) kiteconnect.exceptions.OrderException: Please select a valid BO Order to Exit
@gkannan1965 Please check if the parent and child order id is valid and also the order is not exited with stoploss or target by the time you tried exiting.
order_cancel
call with parent_order_id.orders()
call but ideally it should also be on individual order call, will be fixed in next version.print (kite.order_cancel('160607000057123', variety='bo', parent_order_id='1
60607000057122'))
File "D:\Kan\API_Test\kiteconnect\__init__.py", line 309, in order_cancel
"parent_order_id": parent_order_id
File "D:\Kan\API_Test\kiteconnect\__init__.py", line 447, in _delete
return self._request(route, "DELETE", params)
File "D:\Kan\API_Test\kiteconnect\__init__.py", line 521, in _request
raise(exp(data["message"], code=r.status_code))
kiteconnect.exceptions.OrderException: Please select a valid BO Order to Exit