[Fix] add filter for duplicate ib contract update

This commit is contained in:
vn.py 2019-09-30 12:10:43 +08:00
parent 61bf6bb81e
commit b66e2a9dd2

View File

@ -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