From 656251113701af877fab92a2b22815727f5f768a Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 22 Feb 2022 07:17:12 +0100 Subject: [PATCH] add trade_direction to trade object --- freqtrade/persistence/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index f7317a7d5..18491d687 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -385,6 +385,13 @@ class LocalTrade(): else: return "sell" + @property + def trade_direction(self) -> str: + if self.is_short: + return "short" + else: + return "long" + def __init__(self, **kwargs): for key in kwargs: setattr(self, key, kwargs[key])