示例#1
0
 def handle_bar(context, bar_dict):
     order_id = sell_close(context.f1, 1)
     order = get_order(order_id)
     assert order.order_book_id == context.f1
     assert order.quantity == 1
     assert order.status == ORDER_STATUS.REJECTED
     assert order.unfilled_quantity == 1
     assert order.unfilled_quantity + order.filled_quantity == order.quantity
     assert order.side == SIDE.SELL
     assert order.position_effect == POSITION_EFFECT.CLOSE
示例#2
0
 def handle_bar(context, bar_dict):
     order_id = sell_close(context.f1, 1)
     order = get_order(order_id)
     assert order.order_book_id == context.f1
     assert order.quantity == 1
     assert order.status == ORDER_STATUS.ACTIVE
     assert order.unfilled_quantity == 1
     assert order.unfilled_quantity + order.filled_quantity == order.quantity
     assert order.side == SIDE.SELL
     assert order.position_effect == POSITION_EFFECT.CLOSE
 def handle_bar(context, bar_dict):
     orders = sell_close(context.f1, 1)
     # TODO: Add More Sell Close Test
     assert len(orders) == 0
示例#4
0
 def handle_bar(context, bar_dict):
     orders = sell_close(context.f1, 1)
     # TODO Add More Sell Close Test
     assert len(orders) == 0