[Mod]change logic of is_convert_required function

This commit is contained in:
vn.py 2019-04-26 22:53:25 +08:00
parent 1aa2faf4cb
commit 4cb5e48523

View File

@ -82,10 +82,12 @@ class OffsetConverter:
contract = self.main_engine.get_contract(vt_symbol) contract = self.main_engine.get_contract(vt_symbol)
# Only contracts with long-short position mode requires convert # Only contracts with long-short position mode requires convert
if not contract or not contract.net_position: if not contract:
return True
else:
return False return False
elif contract.net_position:
return False
else:
return True
class PositionHolding: class PositionHolding: