MCPcopy Create free account
hub / github.com/ccxt/ccxt / cancel_order

Method cancel_order

python/ccxt/cryptocom.py:1659–1691  ·  view source on GitHub ↗

cancels an open order https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order :param str id: the order id of the order to cancel :param str [symbol]: unified symbol of the market the order was made in :param dict [params]: extra

(self, id: str, symbol: Str = None, params={})

Source from the content-addressed store, hash-verified

1657 return [self.safe_order({'info': response})]
1658
1659 def cancel_order(self, id: str, symbol: Str = None, params={}):
1660 """
1661 cancels an open order
1662
1663 https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order
1664
1665 :param str id: the order id of the order to cancel
1666 :param str [symbol]: unified symbol of the market the order was made in
1667 :param dict [params]: extra parameters specific to the exchange API endpoint
1668 :returns dict: An `order structure <https://docs.ccxt.com/?id=order-structure>`
1669 """
1670 self.load_markets()
1671 market = None
1672 if symbol is not None:
1673 market = self.market(symbol)
1674 request = {
1675 'order_id': id,
1676 }
1677 response = self.v1PrivatePostPrivateCancelOrder(self.extend(request, params))
1678 #
1679 # {
1680 # "id": 1686882846638,
1681 # "method": "private/cancel-order",
1682 # "code": 0,
1683 # "message": "NO_ERROR",
1684 # "result": {
1685 # "client_oid": "CCXT_c2d2152cc32d40a3ae7fbf",
1686 # "order_id": "6142909895025252686"
1687 # }
1688 # }
1689 #
1690 result = self.safe_dict(response, 'result', {})
1691 return self.parse_order(result, market)
1692
1693 def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
1694 """

Callers

nothing calls this directly

Calls 6

parse_orderMethod · 0.95
safe_dictMethod · 0.80
load_marketsMethod · 0.45
marketMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected