[Mod]修复富途证券接口持仓查询时已平仓合约的数据溢出
This commit is contained in:
parent
35b4da21d9
commit
003f951569
@ -324,6 +324,9 @@ class FutuGateway(VtGateway):
|
|||||||
pos.positionProfit = float(row['pl_val'])
|
pos.positionProfit = float(row['pl_val'])
|
||||||
pos.frozen = int(row['qty']) - int(row['can_sell_qty'])
|
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)
|
self.onPosition(pos)
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user