Exemplo n.º 1
0
 def handle_bar(context, bar_dict):
     order_id = order_shares(context.s1, context.amount, style=LimitOrder(context.limitprice))
     cancel_order(order_id)
     order = get_order(order_id)
     assert order.order_book_id == context.s1
     assert order.filled_quantity == 0
     return order_id
     assert order.price == context.limitprice
Exemplo n.º 2
0
 def handle_bar(context, bar_dict):
     order_id = order_shares(context.s1, context.amount, style=LimitOrder(context.limitprice))
     cancel_order(order_id)
     order = get_order(order_id)
     assert order.order_book_id == context.s1
     assert order.filled_quantity == 0
     return order_id
     assert order.price == context.limitprice
Exemplo n.º 3
0
    def _order_verify(self, event):
        account = event.account
        order = event.order

        if not self._order_condition(account, order):
            cancel_order(order)