fetch all unfilled currently open orders https://bybit-exchange.github.io/docs/v5/order/open-order :param str symbol: unified market symbol :param int [since]: the earliest time in ms to fetch open orders for :param int [limit]: the maximum number of open o
(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})
| 5336 | return self.fetch_canceled_and_closed_orders(symbol, since, limit, self.extend(request, params)) |
| 5337 | |
| 5338 | def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]: |
| 5339 | """ |
| 5340 | fetch all unfilled currently open orders |
| 5341 | |
| 5342 | https://bybit-exchange.github.io/docs/v5/order/open-order |
| 5343 | |
| 5344 | :param str symbol: unified market symbol |
| 5345 | :param int [since]: the earliest time in ms to fetch open orders for |
| 5346 | :param int [limit]: the maximum number of open orders structures to retrieve |
| 5347 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 5348 | :param boolean [params.trigger]: set to True for fetching open trigger orders |
| 5349 | :param boolean [params.stop]: alias for trigger |
| 5350 | :param str [params.type]: market type, ['swap', 'option', 'spot'] |
| 5351 | :param str [params.subType]: market subType, ['linear', 'inverse'] |
| 5352 | :param str [params.baseCoin]: Base coin. Supports linear, inverse & option |
| 5353 | :param str [params.settleCoin]: Settle coin. Supports linear, inverse & option |
| 5354 | :param str [params.orderFilter]: 'Order' or 'StopOrder' or 'tpslOrder' |
| 5355 | :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) |
| 5356 | :returns Order[]: a list of `order structures <https://docs.ccxt.com/?id=order-structure>` |
| 5357 | """ |
| 5358 | self.load_markets() |
| 5359 | paginate = False |
| 5360 | paginate, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'paginate') |
| 5361 | if paginate: |
| 5362 | return self.fetch_paginated_call_cursor('fetchOpenOrders', symbol, since, limit, params, 'nextPageCursor', 'cursor', None, 50) |
| 5363 | request = {} |
| 5364 | market = None |
| 5365 | if symbol is not None: |
| 5366 | market = self.market(symbol) |
| 5367 | request['symbol'] = market['id'] |
| 5368 | type = None |
| 5369 | type, params = self.get_bybit_type('fetchOpenOrders', market, params) |
| 5370 | if type == 'linear' or type == 'inverse': |
| 5371 | baseCoin = self.safe_string(params, 'baseCoin') |
| 5372 | if symbol is None and baseCoin is None: |
| 5373 | defaultSettle = self.safe_string(self.options, 'defaultSettle', 'USDT') |
| 5374 | settleCoin = self.safe_string(params, 'settleCoin', defaultSettle) |
| 5375 | request['settleCoin'] = settleCoin |
| 5376 | request['category'] = type |
| 5377 | isTrigger = self.safe_bool_2(params, 'stop', 'trigger', False) |
| 5378 | params = self.omit(params, ['stop', 'trigger']) |
| 5379 | if isTrigger: |
| 5380 | request['orderFilter'] = 'StopOrder' |
| 5381 | if limit is not None: |
| 5382 | request['limit'] = limit |
| 5383 | response = self.privateGetV5OrderRealtime(self.extend(request, params)) |
| 5384 | # |
| 5385 | # { |
| 5386 | # "retCode": 0, |
| 5387 | # "retMsg": "OK", |
| 5388 | # "result": { |
| 5389 | # "nextPageCursor": "f5f2d355-9a11-4af3-9b83-aa1d6ab6ddfe%3A1757837618905%2Caee7453a-a100-465f-857a-3db780e9329a%3A1757837580469", |
| 5390 | # "category": "linear", |
| 5391 | # "list": [ |
| 5392 | # { |
| 5393 | # "symbol": "BTCUSDT", |
| 5394 | # "orderType": "Market", |
| 5395 | # "orderLinkId": "", |
no test coverage detected