[Mod]change logic of is_convert_required function
This commit is contained in:
parent
1aa2faf4cb
commit
4cb5e48523
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user