cancels an open order https://bingx-api.github.io/docs-v3/#/en/Spot/Trades%20Endpoints/Cancel%20Order https://bingx-api.github.io/docs-v3/#/en/Swap/Trades%20Endpoints/Cancel%20Order https://bingx-api.github.io/docs-v3/#/en/Swap/Trades%20Endpoints/Cancel%20TWAP%20Ord
(self, id: str, symbol: Str = None, params={})
| 3724 | return self.safe_string(statuses, status, status) |
| 3725 | |
| 3726 | def cancel_order(self, id: str, symbol: Str = None, params={}): |
| 3727 | """ |
| 3728 | cancels an open order |
| 3729 | |
| 3730 | https://bingx-api.github.io/docs-v3/#/en/Spot/Trades%20Endpoints/Cancel%20Order |
| 3731 | https://bingx-api.github.io/docs-v3/#/en/Swap/Trades%20Endpoints/Cancel%20Order |
| 3732 | https://bingx-api.github.io/docs-v3/#/en/Swap/Trades%20Endpoints/Cancel%20TWAP%20Order |
| 3733 | https://bingx-api.github.io/docs-v3/#/en/Coin-M%20Futures/Trades%20Endpoints/Cancel%20an%20Order |
| 3734 | |
| 3735 | :param str id: order id |
| 3736 | :param str symbol: unified symbol of the market the order was made in |
| 3737 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 3738 | :param str [params.clientOrderId]: a unique id for the order |
| 3739 | :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>` |
| 3740 | """ |
| 3741 | self.load_markets() |
| 3742 | isTwapOrder = self.safe_bool(params, 'twap', False) |
| 3743 | params = self.omit(params, 'twap') |
| 3744 | response: dict |
| 3745 | market = None |
| 3746 | if isTwapOrder: |
| 3747 | twapRequest = { |
| 3748 | 'mainOrderId': id, |
| 3749 | } |
| 3750 | response = self.swapV1PrivatePostTwapCancelOrder(self.extend(twapRequest, params)) |
| 3751 | # |
| 3752 | # { |
| 3753 | # "code": 0, |
| 3754 | # "msg": "", |
| 3755 | # "timestamp": 1702731661854, |
| 3756 | # "data": { |
| 3757 | # "symbol": "BNB-USDT", |
| 3758 | # "side": "BUY", |
| 3759 | # "positionSide": "LONG", |
| 3760 | # "priceType": "constant", |
| 3761 | # "priceVariance": "2000", |
| 3762 | # "triggerPrice": "68000", |
| 3763 | # "interval": 8, |
| 3764 | # "amountPerOrder": "0.111", |
| 3765 | # "totalAmount": "0.511", |
| 3766 | # "orderStatus": "Running", |
| 3767 | # "executedQty": "0.1", |
| 3768 | # "duration": 800, |
| 3769 | # "maxDuration": 9000, |
| 3770 | # "createdTime": 1702731661854, |
| 3771 | # "updateTime": 1702731661854 |
| 3772 | # } |
| 3773 | # } |
| 3774 | # |
| 3775 | else: |
| 3776 | if symbol is None: |
| 3777 | raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument') |
| 3778 | market = self.market(symbol) |
| 3779 | request = { |
| 3780 | 'symbol': market['id'], |
| 3781 | } |
| 3782 | clientOrderId = self.safe_string_2(params, 'clientOrderId', 'clientOrderID') |
| 3783 | params = self.omit(params, ['clientOrderId']) |
nothing calls this directly
no test coverage detected