From 4cb5e485230c1ec79c9176eeb4ea6cbbfed735fd Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Fri, 26 Apr 2019 22:53:25 +0800 Subject: [PATCH] [Mod]change logic of is_convert_required function --- vnpy/app/cta_strategy/converter.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vnpy/app/cta_strategy/converter.py b/vnpy/app/cta_strategy/converter.py index e12439c8..e8d5423b 100644 --- a/vnpy/app/cta_strategy/converter.py +++ b/vnpy/app/cta_strategy/converter.py @@ -82,10 +82,12 @@ class OffsetConverter: contract = self.main_engine.get_contract(vt_symbol) # Only contracts with long-short position mode requires convert - if not contract or not contract.net_position: - return True - else: + if not contract: return False + elif contract.net_position: + return False + else: + return True class PositionHolding: