[Fix]修复CTP接口组合持仓查询价格报错的bug

This commit is contained in:
vn.py 2017-11-09 09:08:19 +08:00
parent d6b3b0c7c1
commit 49fdc4a978

View File

@ -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)
# 读取冻结