Beispiel #1
0
    def suspend_all_orders(self):
        """
        Suspend all orders across all markets.

        :return: information on the suspension status of each order.
        """
        date_time_sent = datetime.datetime.utcnow()
        response = self.request('SuspendAllOrders', {}, secure=True)
        data = self.process_response(response, date_time_sent, 'Orders', error_handler=err_suspend_orders)
        return [parse_suspended_order(suspend) for suspend in data.get('data', [])] if data.get('data') else []
Beispiel #2
0
    def suspend_orders_by_market(self, MarketId):
        """
        Suspend all orders on a given market.

        :param MarketIds: market id to be suspend orders on.
        :type MarketIds: ints
        :return: information on the suspension status of each order.
        """
        params = clean_locals(locals())
        date_time_sent = datetime.datetime.utcnow()
        response = self.request('SuspendAllOrdersOnMarket', params, secure=True)
        data = self.process_response(response, date_time_sent, 'Orders', error_handler=err_suspend_orders)
        return [parse_suspended_order(suspend) for suspend in data.get('data', [])] if data.get('data') else []
Beispiel #3
0
    def suspend_orders(self, order_ids):
        """
        Suspend one or more orders on exchange

        :param order_ids: list of order ids to be suspended.
        :type order_ids: list of ints
        :return: information on the suspension status of each order.
        """
        params = self.client.secure_types['SuspendOrdersRequest'](
            _value_1=[{'OrderIds': order_id} for order_id in order_ids]
        )
        date_time_sent = datetime.datetime.utcnow()
        response = self.request('SuspendOrders', params, secure=True)
        data = self.process_response(response, date_time_sent, 'Orders', error_handler=err_suspend_orders)
        return [parse_suspended_order(suspend) for suspend in data.get('data', [])] if data.get('data') else []