add trade_direction to trade object

This commit is contained in:
Matthias 2022-02-22 07:17:12 +01:00
parent a2b17882e6
commit 6562511137

View File

@ -385,6 +385,13 @@ class LocalTrade():
else: else:
return "sell" return "sell"
@property
def trade_direction(self) -> str:
if self.is_short:
return "short"
else:
return "long"
def __init__(self, **kwargs): def __init__(self, **kwargs):
for key in kwargs: for key in kwargs:
setattr(self, key, kwargs[key]) setattr(self, key, kwargs[key])