with variety="co" order_id= as the existing SL-M (child order id, which has been successfully looked up using parent order id, that got executed) parent_order_id= the existing Cover order (which has been looked up from existing completed orders table)
what does the function call return? - to indicate that the order has indeed been cancelled?
currently I only see the parent_oid being returned... but no indication like "success/ failure/ old order/ already closed" .. etc.
also... if I choose to cancel off the position using http/ payload call ... what is the URL to call and what are the params?
A successful cancellation request would indicate that a cancel request is placed but it doesn't guarantee the execution. After the API returns success response, you can fetch positions and see if the CO position has 0 net quantity or not. If it is a failure then you can see the reason in the order's status message field.
btw... just for my info... when such a scenario happens... what does the system do? - does it convert my existing SL (that was placed as the second leg order when CO triggered) to a market order? which effectively closes off the position?
If it is a failure then you can see the reason in the order's status message field.
for example, if I pass co 190502001885946 190502001885942
i get this in response 190502001885946 (what should be interpreted)
'status': 'CANCELLED'
.