[Fix] only subscribe if contract data found
This commit is contained in:
parent
5e8a648874
commit
2322406a93
@ -221,6 +221,7 @@ class SpreadDataEngine:
|
|||||||
|
|
||||||
# Subscribe market data
|
# Subscribe market data
|
||||||
contract = self.main_engine.get_contract(vt_symbol)
|
contract = self.main_engine.get_contract(vt_symbol)
|
||||||
|
if contract:
|
||||||
req = SubscribeRequest(
|
req = SubscribeRequest(
|
||||||
contract.symbol,
|
contract.symbol,
|
||||||
contract.exchange
|
contract.exchange
|
||||||
|
Loading…
Reference in New Issue
Block a user