From dc92787f1dc841440c80990af6bc14da5f47a2b4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 25 May 2024 11:52:41 +0200 Subject: [PATCH] Fix gone-wrong hyperopt fix closes #10192 --- .../optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py index e5ec6075e..61e2a6d32 100644 --- a/freqtrade/optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py +++ b/freqtrade/optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py @@ -32,4 +32,6 @@ class ProfitDrawDownHyperOptLoss(IHyperOptLoss): except ValueError: relative_account_drawdown = 0 - return -1 * (total_profit - (relative_account_drawdown * total_profit) / DRAWDOWN_MULT) + return -1 * ( + total_profit - (relative_account_drawdown * total_profit) * (1 - DRAWDOWN_MULT) + )