List open orders of an account
973815
def openorders(ctx, account):
    
    account = Account(
        account or config["default_account"], bitshares_instance=ctx.bitshares
    )
    t = [["Price", "Quote", "Base", "ID"]]
    for o in account.openorders:
        t.append(
            [
                "{:f} {}/{}".format(
                    o["price"],
                    o["base"]["asset"]["symbol"],
                    o["quote"]["asset"]["symbol"],
                ),
                str(o["quote"]),
                str(o["base"]),
                o["id"],
            ]
        )
    print_table(t)
524310
def QA_SU_save_order(orderlist, client=DATABASE):
    
    if isinstance(orderlist, pd.DataFrame):

        collection = client.order
        collection.create_index(
            [('account_cookie',
              ASCENDING),
             ('realorder_id',
              ASCENDING)],
            unique=True
        )
        try:

            orderlist = QA_util_to_json_from_pandas(orderlist.reset_index())

            for item in orderlist:
                if item:
                    #item['date']= QA_util_get_order_day()
                    collection.update_one(
                        {
                            'account_cookie': item.get('account_cookie'),
                            'realorder_id': item.get('realorder_id')
                        },
                        {'$set': item},
                        upsert=True
                    )
        except Exception as e:
            print(e)
            pass
353558
def orders(self):
        
        return [order_cmd for order_cmd in dir(self.handler)
                if getattr(getattr(self.handler, order_cmd), "bot_order", False)]
1052974
def open_orders(self, symbol=None):
        """"""
        api = "order"
        query = {'ordStatus.isTerminated': False }
        if symbol != None:
            query['symbol'] =symbol
        orders = self._curl_bitmex(
            api=api,
            query={'filter': json.dumps(query)},
            verb="GET"
        )
        return orders
479879
def ReqOrderAction(self, OrderID: str):
        
        of = self.orders[OrderID]

        if not of:
            return -1
        else:
            pOrderId = of.OrderID
            return self.t.ReqOrderAction(
                self.broker,
                self.investor,
                OrderRef=pOrderId.split('|')[2],
                FrontID=int(pOrderId.split('|')[1]),
                SessionID=int(pOrderId.split('|')[0]),
                InstrumentID=of.InstrumentID,
                ActionFlag=TThostFtdcActionFlagType.THOST_FTDC_AF_Delete)
607577
def send_margin_order(self, acc_id, amount, symbol, _type, price=0):
        

        params = {
            'account-id': acc_id,
            'amount': amount,
            'symbol': symbol,
            'type': _type,
            'source': 'margin-api'
        }
        if price:
            params['price'] = price

        path = '/v1/order/orders/place'

        def _wrapper(_func):
            @wraps(_func)
            def handle():
                _func(api_key_post(params, path))

            return handle

        return _wrapper
131905
def status_for_all_orders(self):
        
        url_fragment = 'venues/{venue}/accounts/{account}/orders'.format(
            venue=self.venue,
            account=self.account,
        )
        url = urljoin(self.base_url, url_fragment)
        return self.session.get(url).json()
629361
def get_orders(self, instrument=None, count=50):
        
        url = "{0}/{1}/accounts/{2}/orders".format(
            self.domain,
            self.API_VERSION,
            self.account_id
        )
        params = {"instrument": instrument, "count": count}
        try:
            return self._Client__call(uri=url, params=params, method="get")
        except RequestException:
            return False
        except AssertionError:
            return False
1206055
def order_executed(self, orderDict):
        '''  '''
        for orderId, order in orderDict.items():
            if order.security in self.__trakers.keys():
                self.__trakers[order.security].orderExecuted(orderId)
1368652
def reorder_view(self, request):
        """"""
        model = self.model

        if not self.has_change_permission(request):
            raise PermissionDenied

        if request.method == "POST":
            object_pks = request.POST.getlist('neworder[]')
            model.objects.set_orders(object_pks)

        return HttpResponse("OK")
797718
public function accountOrder($user_id, $order_id)
    {
        $this->setUserAccountOrder($user_id);
        $this->setOrderAccountOrder($order_id);
        $this->setTitleAccountOrder();
        $this->setBreadcrumbAccountOrder();

        $this->setData('user', $this->data_user);

        $this->setDataPanelSummaryAccountOrder();
        $this->setDataPanelComponentsAccountOrder();
        $this->setDataPanelPaymentAddressAccountOrder();
        $this->setDataPanelShippingAddressAccountOrder();

        $this->outputAccountOrder();
    }
198126
def status_for_all_orders_in_a_stock(self, stock):
        
        url_fragment = 'venues/{venue}/accounts/{account}/stocks/{stock}/orders'.format(
            stock=stock,
            venue=self.venue,
            account=self.account,
        )
        url = urljoin(self.base_url, url_fragment)
        return self.session.get(url).json()
13952
def unlist(ctx, unlist_account, account):
    
    account = Account(account, blockchain_instance=ctx.blockchain)
    print_tx(account.nolist(unlist_account))
1220506
def ordered(self, ord='desc'):
        """"""
        if ord not in ('asc', 'desc', ):
            raise
        ord_f = getattr(PIDRelation.index, ord)()
        return self.order_by(ord_f)
1182411
def list_orders(self, params=None):
        """"""
        request = self._get('transactions/orders', params)
        return self.responder(request)
740762
def get_orders(self, **params):
        """"""
        response = self._get('v2', 'orders', params=params)
        return self._make_api_object(response, Order)
743135
public AbucoinsOrder[] getAbucoinsOrders(AbucoinsOrderRequest request) throws IOException {
    AbucoinsOrder.Status status = null;
    String productID = null;
    if (request != null) {
      status = request.getStatus();
      productID = request.getProductID();
    }

    if (status != null) {
      switch (status) {
        default:
        case open:
        case done:
          break;

        case pending:
        case rejected:
          throw new IllegalArgumentException(
              "/orders only accepts status of 'open' or 'done' not " + status);
      }
    }

    AbucoinsOrders retVal = null;
    if (status == null) {
      if (productID == null)
        retVal =
            abucoinsAuthenticated.getOrders(
                exchange.getExchangeSpecification().getApiKey(),
                signatureCreator,
                exchange.getExchangeSpecification().getPassword(),
                timestamp());
      else
        retVal =
            abucoinsAuthenticated.getOrdersByProductID(
                productID,
                exchange.getExchangeSpecification().getApiKey(),
                signatureCreator,
                exchange.getExchangeSpecification().getPassword(),
                timestamp());
    } else {
      if (productID == null)
        retVal =
            abucoinsAuthenticated.getOrdersByStatus(
                status.name(),
                exchange.getExchangeSpecification().getApiKey(),
                signatureCreator,
                exchange.getExchangeSpecification().getPassword(),
                timestamp());
      else
        retVal =
            abucoinsAuthenticated.getOrdersByStatusAndProductID(
                status.name(),
                productID,
                exchange.getExchangeSpecification().getApiKey(),
                signatureCreator,
                exchange.getExchangeSpecification().getPassword(),
                timestamp());
    }

    if (retVal.getOrders().length == 1 && retVal.getOrders()[0].getMessage() != null)
      throw new ExchangeException(retVal.getOrders()[0].getMessage());

    return retVal.getOrders();
  }