From 7aae9565c7f101fc1fd13d68a81e8dc78ec8307d Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 30 Jan 2022 14:07:21 +0100 Subject: [PATCH] Only look at buy orders when looking to recalculate trade value --- freqtrade/persistence/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index 76886d8ae..411db3fa7 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -569,8 +569,8 @@ class LocalTrade(): return float(f"{profit_ratio:.8f}") def recalc_trade_from_orders(self): - # We need at least 2 orders for averaging amounts and rates. - if len(self.orders) < 2: + # We need at least 2 entry orders for averaging amounts and rates. + if len(self.select_filled_orders('buy')) < 2: # Just in case, still recalc open trade value self.recalc_open_trade_value() return