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

Method fetch_open_order

python/ccxt/bybit.py:5143–5173  ·  view source on GitHub ↗

fetches information on an open order made by the user https://bybit-exchange.github.io/docs/v5/order/open-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 t

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

Source from the content-addressed store, hash-verified

5141 return self.safe_value(result, 0)
5142
5143 def fetch_open_order(self, id: str, symbol: Str = None, params={}) -> Order:
5144 """
5145 fetches information on an open order made by the user
5146
5147 https://bybit-exchange.github.io/docs/v5/order/open-order
5148
5149 :param str id: order id
5150 :param str [symbol]: unified symbol of the market the order was made in
5151 :param dict [params]: extra parameters specific to the exchange API endpoint
5152 :param boolean [params.trigger]: set to True for fetching an open trigger order
5153 :param boolean [params.stop]: alias for trigger
5154 :param str [params.type]: market type, ['swap', 'option', 'spot']
5155 :param str [params.subType]: market subType, ['linear', 'inverse']
5156 :param str [params.baseCoin]: Base coin. Supports linear, inverse & option
5157 :param str [params.settleCoin]: Settle coin. Supports linear, inverse & option
5158 :param str [params.orderFilter]: 'Order' or 'StopOrder' or 'tpslOrder'
5159 :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>`
5160 """
5161 self.load_markets()
5162 request = {
5163 'orderId': id,
5164 }
5165 result = self.fetch_open_orders(symbol, None, None, self.extend(request, params))
5166 length = len(result)
5167 if length == 0:
5168 isTrigger = self.safe_bool_n(params, ['trigger', 'stop'], False)
5169 extra = '' if isTrigger else ' If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = True'
5170 raise OrderNotFound('Order ' + str(id) + ' was not found.' + extra)
5171 if length > 1:
5172 raise InvalidOrder(self.id + ' returned more than one order')
5173 return self.safe_value(result, 0)
5174
5175 def fetch_canceled_and_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
5176 """

Callers

nothing calls this directly

Calls 7

fetch_open_ordersMethod · 0.95
OrderNotFoundClass · 0.90
InvalidOrderClass · 0.90
safe_bool_nMethod · 0.80
safe_valueMethod · 0.80
load_marketsMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected