From b66e2a9dd2ff7e1453a15a26d0f6ed569f219afd Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Mon, 30 Sep 2019 12:10:43 +0800 Subject: [PATCH] [Fix] add filter for duplicate ib contract update --- vnpy/gateway/ib/ib_gateway.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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