cancels an open order https://docs.whitebit.com/private/http-trade-v4/#cancel-order :param str id: order id :param str symbol: unified symbol of the market the order was made in :param dict [params]: extra parameters specific to the exchange API endpoint
(self, id: str, symbol: Str = None, params={})
| 2025 | return self.parse_order(response) |
| 2026 | |
| 2027 | def cancel_order(self, id: str, symbol: Str = None, params={}): |
| 2028 | """ |
| 2029 | cancels an open order |
| 2030 | |
| 2031 | https://docs.whitebit.com/private/http-trade-v4/#cancel-order |
| 2032 | |
| 2033 | :param str id: order id |
| 2034 | :param str symbol: unified symbol of the market the order was made in |
| 2035 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 2036 | :returns dict: An `order structure <https://docs.ccxt.com/?id=order-structure>` |
| 2037 | """ |
| 2038 | if symbol is None: |
| 2039 | raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument') |
| 2040 | self.load_markets() |
| 2041 | market = self.market(symbol) |
| 2042 | request = { |
| 2043 | 'market': market['id'], |
| 2044 | 'orderId': int(id), |
| 2045 | } |
| 2046 | response = self.v4PrivatePostOrderCancel(self.extend(request, params)) |
| 2047 | # |
| 2048 | # { |
| 2049 | # "orderId": 4180284841, # order id |
| 2050 | # "clientOrderId": "customId11", # custom order identifier; "clientOrderId": "" - if not specified. |
| 2051 | # "market": "BTC_USDT", # deal market |
| 2052 | # "side": "buy", # order side |
| 2053 | # "type": "stop market", # order type |
| 2054 | # "timestamp": 1595792396.165973, # current timestamp |
| 2055 | # "dealMoney": "0", # if order finished - amount in money currency that is finished |
| 2056 | # "dealStock": "0", # if order finished - amount in stock currency that is finished |
| 2057 | # "amount": "0.001", # amount |
| 2058 | # "takerFee": "0.001", # maker fee ratio. If the number less than 0.0001 - it will be rounded to zero |
| 2059 | # "makerFee": "0.001", # maker fee ratio. If the number less than 0.0001 - it will be rounded to zero |
| 2060 | # "left": "0.001", # if order not finished - rest of the amount that must be finished |
| 2061 | # "dealFee": "0", # fee in money that you pay if order is finished |
| 2062 | # "price": "40000", # price if price isset |
| 2063 | # "activation_price": "40000" # activation price if activation price is set |
| 2064 | # } |
| 2065 | # |
| 2066 | return self.parse_order(response) |
| 2067 | |
| 2068 | def cancel_all_orders(self, symbol: Str = None, params={}): |
| 2069 | """ |
nothing calls this directly
no test coverage detected