From 6a50362eec0d025a2e894bcf33f3c1e73ab67c61 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Wed, 9 Oct 2019 16:24:27 +0800 Subject: [PATCH] [Mod] process INE order in similar way with SHFE --- vnpy/trader/converter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vnpy/trader/converter.py b/vnpy/trader/converter.py index 0c30ff06..d42a39eb 100644 --- a/vnpy/trader/converter.py +++ b/vnpy/trader/converter.py @@ -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