(self)
return self.converge_orders(buy_orders, sell_orders)
Create order items for use in convergence.
Create order items for use in convergence.
Create order items for use in convergence .
def place_orders(self):
        """Create order items for use in convergence."""

        buy_orders = []
        sell_orders = []
        # Create orders from the outside in. This is intentional - let's say the inner order gets taken;
        # then we match orders from the outside in, ensuring the fewest number of orders are amended and only
        # a new order is created in the inside. If we did it inside-out, all orders would be amended
        # down and a new order would be created at the outside.
        if self.enough_liquidity():
            for i in reversed(range(1, settings.ORDER_PAIRS + 1)):
                if not self.long_position_limit_exceeded():
                    buy_orders.append(self.prepare_order(-i))
                if not self.short_position_limit_exceeded():
                    sell_orders.append(self.prepare_order(i))

        return self.converge_orders(buy_orders, sell_orders)
def place_orders ( self ) : buy_orders = [ ] sell_orders = [ ] # Create orders from the outside in. This is intentional - let's say the inner order gets taken; # then we match orders from the outside in, ensuring the fewest number of orders are amended and only # a new order is created in the inside. If we did it inside-out, all orders would be amended # down and a new order would be created at the outside. if self . enough_liquidity ( ) : for i in reversed ( range ( 1 , settings . ORDER_PAIRS + 1 ) ) : if not self . long_position_limit_exceeded ( ) : buy_orders . append ( self . prepare_order ( - i ) ) if not self . short_position_limit_exceeded ( ) : sell_orders . append ( self . prepare_order ( i ) ) return self . converge_orders ( buy_orders , sell_orders )