Canceling Cover Order Py client

Vishesh edited May 2019 in Python client

When I execute this call...


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? - only mentions bracket and regular orders... is there a separate url for covers? like ... /co?
  • sujith
    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.
  • Vishesh
    @sujith : what is a success response? - I only get orderid in python as return value...

    for example, if I pass co 190502001885946 190502001885942

    i get this in response 190502001885946 (what should be interpreted)
  • rakeshr
    what is a success response? - I only get orderid in python as return value.
    You can fetch complete order_book and filter specific order_id and check for status, it should be 'status': 'CANCELLED'.
  • Vishesh
    ok thanks, I'll get back to you folks if I hit a wall
  • Vishesh
    Vishesh edited May 2019
    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?
Sign In or Register to comment.