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

Method cancel_order

python/ccxt/bybit.py:4564–4597  ·  view source on GitHub ↗

cancels an open order https://bybit-exchange.github.io/docs/v5/order/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={})

Source from the content-addressed store, hash-verified

4562 return self.extend(request, params)
4563
4564 def cancel_order(self, id: str, symbol: Str = None, params={}) -> Order:
4565 """
4566 cancels an open order
4567
4568 https://bybit-exchange.github.io/docs/v5/order/cancel-order
4569
4570 :param str id: order id
4571 :param str symbol: unified symbol of the market the order was made in
4572 :param dict [params]: extra parameters specific to the exchange API endpoint
4573 :param boolean [params.trigger]: *spot only* whether the order is a trigger order
4574 :param boolean [params.stop]: alias for trigger
4575 :param str [params.orderFilter]: *spot only* 'Order' or 'StopOrder' or 'tpslOrder'
4576 :returns dict: An `order structure <https://docs.ccxt.com/?id=order-structure>`
4577 """
4578 if symbol is None:
4579 raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
4580 self.load_markets()
4581 market = self.market(symbol)
4582 requestExtended = self.cancel_order_request(id, symbol, params)
4583 response = self.privatePostV5OrderCancel(requestExtended)
4584 #
4585 # {
4586 # "retCode": 0,
4587 # "retMsg": "OK",
4588 # "result": {
4589 # "orderId": "c6f055d9-7f21-4079-913d-e6523a9cfffa",
4590 # "orderLinkId": "linear-004"
4591 # },
4592 # "retExtInfo": {},
4593 # "time": 1672217377164
4594 # }
4595 #
4596 result = self.safe_dict(response, 'result', {})
4597 return self.parse_order(result, market)
4598
4599 def cancel_orders(self, ids: List[str], symbol: Str = None, params={}) -> List[Order]:
4600 """

Callers

nothing calls this directly

Calls 7

cancel_order_requestMethod · 0.95
parse_orderMethod · 0.95
ArgumentsRequiredClass · 0.90
safe_dictMethod · 0.80
load_marketsMethod · 0.45
marketMethod · 0.45

Tested by

no test coverage detected