From 41a4c7c39f8720c2381fc13f8c88c1a74dd723a5 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 21 Oct 2024 06:39:55 +0200 Subject: [PATCH] chore: improve type safety --- freqtrade/data/metrics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/data/metrics.py b/freqtrade/data/metrics.py index 77f29080c..de8ebac4a 100644 --- a/freqtrade/data/metrics.py +++ b/freqtrade/data/metrics.py @@ -261,8 +261,8 @@ def calculate_expectancy(trades: pd.DataFrame) -> tuple[float, float]: :return: expectancy, expectancy_ratio """ - expectancy = 0 - expectancy_ratio = 100 + expectancy = 0.0 + expectancy_ratio = 100.0 if len(trades) > 0: winning_trades = trades.loc[trades["profit_abs"] > 0]