From 30d293bfec903036da3480af824cc110a6f0e70a Mon Sep 17 00:00:00 2001 From: Reigo Reinmets Date: Mon, 10 Jan 2022 20:16:11 +0200 Subject: [PATCH] Fix bug with None in backtesting. --- 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 d515d8782..1bc4cfc05 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -621,7 +621,7 @@ class LocalTrade(): """ return len([o for o in self.orders if o.ft_order_side == 'buy' and o.status in NON_OPEN_EXCHANGE_STATES and - o.filled > 0]) + (o.filled or 0) > 0]) def nr_of_successful_sells(self) -> int: """ @@ -630,7 +630,7 @@ class LocalTrade(): """ return len([o for o in self.orders if o.ft_order_side == 'sell' and o.status in NON_OPEN_EXCHANGE_STATES and - o.filled > 0]) + (o.filled or 0) > 0]) @staticmethod def get_trades_proxy(*, pair: str = None, is_open: bool = None,