def on_order(self, order: OrderData): """""" if order.vt_symbol == self.active_vt_symbol: if not order.is_active(): self.active_vt_orderid = "" elif order.vt_symbol == self.passive_vt_symbol: if not order.is_active(): self.passive_vt_orderid = "" self.put_variables_event()
def update_order(self, order: OrderData): """ Callback when order status is updated. """ if not order.is_active() and order.vt_orderid in self.vt_orderids: self.vt_orderids.remove(order.vt_orderid) self.on_order(order)
def on_order(self, order: OrderData): """""" self.traded = order.traded self.order_status = order.status if not order.is_active(): self.stop() self.put_variables_event()
def update_order(self, order: OrderData) -> None: """ Callback of new order data update. """ self.orders[order.vt_orderid] = order if not order.is_active() and order.vt_orderid in self.active_orderids: self.active_orderids.remove(order.vt_orderid)
def on_order(self, order: OrderData): """""" msg = f"委托号:{order.vt_orderid},委托状态:{order.status.value}" self.write_log(msg) if not order.is_active(): self.vt_orderid = "" self.put_variables_event()
def update_order(self, order: OrderData): """""" if self.active: if order.is_active(): self.active_orders[order.vt_orderid] = order elif order.vt_orderid in self.active_orders: self.active_orders.pop(order.vt_orderid) self.on_order(order)
def on_order(self, order: OrderData): """ Callback of new order data update. """ vt_orderid = order.vt_orderid if not order.is_active(): if vt_orderid in self.active_orderids: self.active_orderids.remove(vt_orderid) if vt_orderid in self.cancel_orderids: self.cancel_orderids.remove(vt_orderid)
def on_order(self, order: OrderData): """""" if not order.is_active(): self.vt_orderid = "" self.put_variables_event()