MCPcopy
hub / github.com/danpaquin/coinbasepro-python / get_orders

Method get_orders

cbpro/authenticated_client.py:558–621  ·  view source on GitHub ↗

List your current open orders. This method returns a generator which may make multiple HTTP requests while iterating through it. Only open or un-settled orders are returned. As soon as an order is no longer open and settled, it will no longer appear in the

(self, product_id=None, status=None, **kwargs)

Source from the content-addressed store, hash-verified

556 return self._send_message('get', '/orders/' + order_id)
557
558 def get_orders(self, product_id=None, status=None, **kwargs):
559 """ List your current open orders.
560
561 This method returns a generator which may make multiple HTTP requests
562 while iterating through it.
563
564 Only open or un-settled orders are returned. As soon as an
565 order is no longer open and settled, it will no longer appear
566 in the default request.
567
568 Orders which are no longer resting on the order book, will be
569 marked with the 'done' status. There is a small window between
570 an order being 'done' and 'settled'. An order is 'settled' when
571 all of the fills have settled and the remaining holds (if any)
572 have been removed.
573
574 For high-volume trading it is strongly recommended that you
575 maintain your own list of open orders and use one of the
576 streaming market data feeds to keep it updated. You should poll
577 the open orders endpoint once when you start trading to obtain
578 the current state of any open orders.
579
580 Args:
581 product_id (Optional[str]): Only list orders for this
582 product
583 status (Optional[list/str]): Limit list of orders to
584 this status or statuses. Passing 'all' returns orders
585 of all statuses.
586 ** Options: 'open', 'pending', 'active', 'done',
587 'settled'
588 ** default: ['open', 'pending', 'active']
589
590 Returns:
591 list: Containing information on orders. Example::
592 [
593 {
594 "id": "d0c5340b-6d6c-49d9-b567-48c4bfca13d2",
595 "price": "0.10000000",
596 "size": "0.01000000",
597 "product_id": "BTC-USD",
598 "side": "buy",
599 "stp": "dc",
600 "type": "limit",
601 "time_in_force": "GTC",
602 "post_only": false,
603 "created_at": "2016-12-08T20:02:28.53864Z",
604 "fill_fees": "0.0000000000000000",
605 "filled_size": "0.00000000",
606 "executed_value": "0.0000000000000000",
607 "status": "open",
608 "settled": false
609 },
610 {
611 ...
612 }
613 ]
614
615 """

Callers 2

test_get_ordersMethod · 0.80
test_get_fillsMethod · 0.80

Calls 1

Tested by 2

test_get_ordersMethod · 0.64
test_get_fillsMethod · 0.64