Has the button of "Exit AtMarket And Cancel" API endpiont?

Exit AtMarket And Cancel is a good action ,but I has no found in api doc, If I need user it ,I must Implement it by cancel the pending orders and clear position by placse order endpoint?

Yes, what the Trader Application does to accomplish this is iterate over all a user’s open positions and attempt to liquidate them using the /order/liquidatePosition endpoint (docs).

1 Like

I try ,but it Access denied

 send:order/liquidateposition body:{"accountId":xxx,"contractId":2553028,"admin":true} error:"Access is denied"

My be is the device Id not Aprove?

Try it with "admin": false instead and let me know if that works.

1 Like

user admin =false, it worked in demo model ,Thanks

1 Like

Is there a function that only closes the pending positions or positions in status “working”? Versus closing the pending orders and liquidating the positions?