[Fix] ctpGateway: 修正一个在查询持仓时,若未查询过该合约大小则出错的BUG
This commit is contained in:
parent
904895899a
commit
24198b82be
@ -734,6 +734,8 @@ class CtpTdApi(TdApi):
|
||||
pos.ydPosition = data['Position'] - data['TodayPosition']
|
||||
|
||||
# 计算成本
|
||||
if pos.symbol not in self.symbolSizeDict:
|
||||
return
|
||||
size = self.symbolSizeDict[pos.symbol]
|
||||
cost = pos.price * pos.position * size
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user