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
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
def _order_verify(self, event): account = event.account order = event.order if not self._order_condition(account, order): cancel_order(order)