[Fix]修复CTP接口组合持仓查询价格报错的bug
This commit is contained in:
parent
d6b3b0c7c1
commit
49fdc4a978
@ -743,7 +743,7 @@ class CtpTdApi(TdApi):
|
||||
pos.positionProfit += data['PositionProfit']
|
||||
|
||||
# 计算持仓均价
|
||||
if pos.position and pos.symbol in self.symbolSizeDict:
|
||||
if pos.position and size:
|
||||
pos.price = (cost + data['PositionCost']) / (pos.position * size)
|
||||
|
||||
# 读取冻结
|
||||
|
Loading…
Reference in New Issue
Block a user