diff --git a/vnpy/trader/engine.py b/vnpy/trader/engine.py index 5a5c066..6a956a1 100644 --- a/vnpy/trader/engine.py +++ b/vnpy/trader/engine.py @@ -412,31 +412,16 @@ def process_order_event(self, event: Event) -> None: elif order.vt_orderid in self.active_orders: self.active_orders.pop(order.vt_orderid) - # Update to offset converter - converter: OffsetConverter = self.offset_converters.get(order.gateway_name, None) - if converter: - converter.update_order(order) - def process_trade_event(self, event: Event) -> None: """""" trade: TradeData = event.data self.trades[trade.vt_tradeid] = trade - # Update to offset converter - converter: OffsetConverter = self.offset_converters.get(trade.gateway_name, None) - if converter: - converter.update_trade(trade) - def process_position_event(self, event: Event) -> None: """""" position: PositionData = event.data self.positions[position.vt_positionid] = position - # Update to offset converter - converter: OffsetConverter = self.offset_converters.get(position.gateway_name, None) - if converter: - converter.update_position(position) - def process_account_event(self, event: Event) -> None: """""" account: AccountData = event.data @@ -447,10 +432,6 @@ def process_contract_event(self, event: Event) -> None: contract: ContractData = event.data self.contracts[contract.vt_symbol] = contract - # Initialize offset converter for each gateway - if contract.gateway_name not in self.offset_converters: - self.offset_converters[contract.gateway_name] = OffsetConverter(self) - def process_quote_event(self, event: Event) -> None: """""" quote: QuoteData = event.data @@ -582,9 +563,7 @@ def update_order_request(self, req: OrderRequest, vt_orderid: str, gateway_name: """ Update order request to offset converter. """ - converter: OffsetConverter = self.offset_converters.get(gateway_name, None) - if converter: - converter.update_order_request(req, vt_orderid) + pass def convert_order_request( self, @@ -596,12 +575,7 @@ def convert_order_request( """ Convert original order request according to given mode. """ - converter: OffsetConverter = self.offset_converters.get(gateway_name, None) - if not converter: - return [req] - - reqs: List[OrderRequest] = converter.convert_order_request(req, lock, net) - return reqs + return [req] def get_converter(self, gateway_name: str) -> OffsetConverter: """