From 2893d0b50db94d7aa6f98e29674e57468b476dc2 Mon Sep 17 00:00:00 2001 From: zx <54022220+ediziks@users.noreply.github.com> Date: Mon, 7 Feb 2022 06:22:27 +0100 Subject: [PATCH] proper var name --- freqtrade/optimize/hyperopt_loss_profit_drawdown.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/optimize/hyperopt_loss_profit_drawdown.py b/freqtrade/optimize/hyperopt_loss_profit_drawdown.py index 6df605c82..957663827 100644 --- a/freqtrade/optimize/hyperopt_loss_profit_drawdown.py +++ b/freqtrade/optimize/hyperopt_loss_profit_drawdown.py @@ -14,7 +14,7 @@ from freqtrade.optimize.hyperopt import IHyperOptLoss # higher numbers penalize drawdowns more severely -DRAWDOWN_MULT = 0.075 +DRAWDOWN_MULT = 0.01 class ProfitDrawDownHyperOptLoss(IHyperOptLoss): @@ -23,8 +23,8 @@ class ProfitDrawDownHyperOptLoss(IHyperOptLoss): total_profit = results["profit_abs"].sum() try: - profit_abs, _, _, _, _ = calculate_max_drawdown(results, value_col="profit_abs") + max_drawdown_abs, _, _, _, _ = calculate_max_drawdown(results, value_col="profit_abs") except ValueError: - profit_abs = 0 + max_drawdown_abs = 0 - return -1 * (total_profit * (1 - profit_abs * DRAWDOWN_MULT)) + return -1 * (total_profit * (1 - max_drawdown_abs * DRAWDOWN_MULT))