def on_order(self, order: OrderData):
    '报单更新'
    self.write_log(u'{}报单更新 => {}'.format(self.cur_datetime, order.__dict__))
    self.fix_order(order)
    if (order.vt_orderid in self.active_orders):
        active_order = self.active_orders[order.vt_orderid]
        if ((order.volume == order.traded) and (order.status in [Status.ALLTRADED])):
            self.on_order_all_traded(order)
        elif ((active_order['offset'] == Offset.OPEN) and (order.status in [Status.CANCELLED])):
            self.on_order_open_canceled(order)
        elif ((active_order['offset'] != Offset.OPEN) and (order.status in [Status.CANCELLED])):
            self.on_order_close_canceled(order)
        elif (order.status == Status.REJECTED):
            if (active_order['offset'] == Offset.OPEN):
                self.write_error(u'{}委托单开{}被拒，price:{},total:{},traded:{}，status:{}'.format(order.vt_symbol, order.direction, order.price, order.volume, order.traded, order.status))
                self.on_order_open_canceled(order)
            else:
                self.write_error(u'OnOrder({})委托单平{}被拒，price:{},total:{},traded:{}，status:{}'.format(order.vt_symbol, order.direction, order.price, order.volume, order.traded, order.status))
                self.on_order_close_canceled(order)
        else:
            self.write_log(u'委托单未完成,total:{},traded:{},tradeStatus:{}'.format(order.volume, order.traded, order.status))
    else:
        self.write_error(u'委托单{}不在策略的未完成订单列表中:{}'.format(order.vt_orderid, self.active_orders))
报单更新
def on_order(self, order: OrderData):
    
    self.write_log(u'{} => {}'.format(self.cur_datetime, order.__dict__))
    self.fix_order(order)
    if (order.vt_orderid in self.active_orders):
        active_order = self.active_orders[order.vt_orderid]
        if ((order.volume == order.traded) and (order.status in [Status.ALLTRADED])):
            self.on_order_all_traded(order)
        elif ((active_order['offset'] == Offset.OPEN) and (order.status in [Status.CANCELLED])):
            self.on_order_open_canceled(order)
        elif ((active_order['offset'] != Offset.OPEN) and (order.status in [Status.CANCELLED])):
            self.on_order_close_canceled(order)
        elif (order.status == Status.REJECTED):
            if (active_order['offset'] == Offset.OPEN):
                self.write_error(u'{}委托单开{}被拒，price:{},total:{},traded:{}，status:{}'.format(order.vt_symbol, order.direction, order.price, order.volume, order.traded, order.status))
                self.on_order_open_canceled(order)
            else:
                self.write_error(u'OnOrder({})委托单平{}被拒，price:{},total:{},traded:{}，status:{}'.format(order.vt_symbol, order.direction, order.price, order.volume, order.traded, order.status))
                self.on_order_close_canceled(order)
        else:
            self.write_log(u'委托单未完成,total:{},traded:{},tradeStatus:{}'.format(order.volume, order.traded, order.status))
    else:
        self.write_error(u'委托单{}不在策略的未完成订单列表中:{}'.format(order.vt_orderid, self.active_orders))