[Mod] process INE order in similar way with SHFE

This commit is contained in:
vn.py 2019-10-09 16:24:27 +08:00
parent 5aadb46bef
commit 6a50362eec

View File

@ -154,7 +154,7 @@ class PositionHolding:
elif trade.offset == Offset.CLOSEYESTERDAY:
self.short_yd -= trade.volume
elif trade.offset == Offset.CLOSE:
if trade.exchange == Exchange.SHFE:
if trade.exchange in [Exchange.SHFE, Exchange.INE]:
self.short_yd -= trade.volume
else:
self.short_td -= trade.volume
@ -170,7 +170,7 @@ class PositionHolding:
elif trade.offset == Offset.CLOSEYESTERDAY:
self.long_yd -= trade.volume
elif trade.offset == Offset.CLOSE:
if trade.exchange == Exchange.SHFE:
if trade.exchange in [Exchange.SHFE, Exchange.INE]:
self.long_yd -= trade.volume
else:
self.long_td -= trade.volume
@ -283,7 +283,7 @@ class PositionHolding:
if yd_available:
req_yd = copy(req)
if self.exchange == Exchange.SHFE:
if self.exchange in [Exchange.SHFE, Exchange.INE]:
req_yd.offset = Offset.CLOSEYESTERDAY
else:
req_yd.offset = Offset.CLOSE