diff --git a/vnpy/gateway/ib/ib_gateway.py b/vnpy/gateway/ib/ib_gateway.py index a427014c..f3d36acd 100644 --- a/vnpy/gateway/ib/ib_gateway.py +++ b/vnpy/gateway/ib/ib_gateway.py @@ -509,9 +509,9 @@ class IbApi(EWrapper): gateway_name=self.gateway_name, ) - self.gateway.on_contract(contract) - - self.contracts[contract.vt_symbol] = contract + if contract.vt_symbol not in self.contracts: + self.gateway.on_contract(contract) + self.contracts[contract.vt_symbol] = contract def execDetails( self, reqId: int, contract: Contract, execution: Execution