[Mod]修复富途证券接口持仓查询时已平仓合约的数据溢出

This commit is contained in:
vn.py 2017-10-27 16:29:07 +08:00
parent 35b4da21d9
commit 003f951569

View File

@ -324,6 +324,9 @@ class FutuGateway(VtGateway):
pos.positionProfit = float(row['pl_val'])
pos.frozen = int(row['qty']) - int(row['can_sell_qty'])
if pos.price < 0: pos.price = 0
if pos.positionProfit > 100000000: pos.positionProfit = 0
self.onPosition(pos)
#----------------------------------------------------------------------