Ejemplo n.º 1
0
    def create_sl_order_entry(orderid, price, contractsize):

        orderModel = OrderModel()
        orderModel.orderId = orderid
        orderModel.contractSize = contractsize
        orderModel.price = price
        orderModel.status = "open"
        orderModel.direction = "sell"
        orderModel.iuid = str(uuid.uuid4())
        orderModel.save()

        return orderModel
Ejemplo n.º 2
0
    def create_order_entry(orderid, price, contractsize, direction):

        orderModel = OrderModel()
        orderModel.orderId = orderid
        orderModel.contractSize = contractsize
        orderModel.price = price
        orderModel.status = "pending"
        orderModel.direction = direction
        orderModel.iuid = str(uuid.uuid4())
        orderModel.save()

        return orderModel
Ejemplo n.º 3
0
    def create_order_entry(orderid, price, contractsize, direction):
        
        orderModel = OrderModel()
        orderModel.orderId = orderid
        orderModel.contractSize = contractsize
        orderModel.price = price
        orderModel.status = "Open"
        orderModel.direction = direction
        orderModel.save()

        return orderModel
Ejemplo n.º 4
0
    def get_order_by_id(orderid):

        try:

            orderModel = OrderModel.get(OrderModel.orderid == orderid)
            return orderModel

        except:

            Util.get_logger().debug("Failed to retrieve order: " + str(orderid))
            return None
Ejemplo n.º 5
0
    def update_sell_order_entry(orderid, amount):
        try:

            orderModel = OrderModel.get(OrderModel.orderId == orderid)
            orderModel.amount = amount
            orderModel.save()

            return orderModel

        except:

            Util.get_logger().debug("Failed to retrieve order: " + str(orderid))
            return None  
Ejemplo n.º 6
0
    def update_order_entry(orderid, status):
        
        try:

            orderModel = OrderModel.get(OrderModel.orderId == orderid)
            orderModel.status = status
            orderModel.save()

            return orderModel

        except:

            Util.get_logger().debug("Failed to retrieve order: " + str(orderid))
            return None
Ejemplo n.º 7
0
 def get_open_sell_order():
     try:
         return OrderModel.select().where(OrderModel.status == 'Open' & OrderModel.direction == "sell")
     except:
         return None
Ejemplo n.º 8
0
 def get_all_open_orders():
     return OrderModel.select().where(OrderModel.status == 'Open')
Ejemplo n.º 9
0
 def get_all_orders():
     return OrderModel.select()
Ejemplo n.º 10
0
 def get_all_pending_orders():
     return OrderModel.select().where((OrderModel.orderId == '')
                                      & (OrderModel.status == "pending"))