Merge pull request #5926 from samgermain/has-no-leverage

Trade.has_no_leverage makes more sense
This commit is contained in:
Matthias 2021-11-20 11:31:36 +01:00 committed by GitHub
commit 32a56bbd4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -283,7 +283,7 @@ class LocalTrade():
@property
def has_no_leverage(self) -> bool:
"""Returns true if this is a non-leverage, non-short trade"""
return ((self.leverage or self.leverage is None) == 1.0 and not self.is_short)
return ((self.leverage == 1.0 or self.leverage is None) and not self.is_short)
@property
def borrowed(self) -> float: