ftx icon indicating copy to clipboard operation
ftx copied to clipboard

Can't cancel trigger orders with the cancel order function

Open anton-r99 opened this issue 3 years ago • 3 comments

Can't cancel trigger orders with the cancel_order() Probably need to have another function with DELETE /conditional_orders/{id}

anton-r99 avatar Mar 05 '21 16:03 anton-r99

i have used client.cancel_orders(pair) to cancel all trigger orders on a specific coin. also works without pair, but of course does on all coins.

zombiegriff avatar Mar 07 '21 00:03 zombiegriff

cancel_order needs an order id to know which order to cancel. you can specify conditional or limit order in cancel_orders(line 153 maybe)

line 149 def cancel_order(self, order_id: str) -> dict: return self._delete(f'orders/{order_id}')

zombiegriff avatar Mar 07 '21 00:03 zombiegriff

i've just added @authentication_required def cancel_trigger_order(self, order_id: str) -> dict: return self._delete(f'conditional_orders/{order_id}')

and it works just fine

On Sun, Mar 7, 2021 at 1:26 AM zombiegriff [email protected] wrote:

cancel_order needs an order id to know which order to cancel. you can specify conditional or limit order in cancel_orders(line 153 maybe)

line 149 def cancel_order(self, order_id: str) -> dict: return self._delete(f'orders/{order_id}')

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/quan-digital/ftx/issues/8#issuecomment-792129482, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQCGUYP7FD5FFJI46CSSTKDTCLB33ANCNFSM4YVRTUOQ .

anton-r99 avatar Mar 07 '21 13:03 anton-r99