From c3414c3b78eeddf2f1af4877a64c61643fa2a52e Mon Sep 17 00:00:00 2001 From: Robert Roman Date: Mon, 27 Sep 2021 17:32:49 -0500 Subject: [PATCH] resolved mypy error error: Signature of "hyperopt_loss_function" incompatible with supertype "IHyperOptLoss" --- freqtrade/optimize/hyperopt_loss_calmar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/optimize/hyperopt_loss_calmar.py b/freqtrade/optimize/hyperopt_loss_calmar.py index 45a7cd7db..802aa949b 100644 --- a/freqtrade/optimize/hyperopt_loss_calmar.py +++ b/freqtrade/optimize/hyperopt_loss_calmar.py @@ -27,6 +27,8 @@ class CalmarHyperOptLoss(IHyperOptLoss): trade_count: int, min_date: datetime, max_date: datetime, + config: Dict, + processed: Dict[str, DataFrame], backtest_stats: Dict[str, Any], *args, **kwargs @@ -52,7 +54,7 @@ class CalmarHyperOptLoss(IHyperOptLoss): except ValueError: max_drawdown = 0 - if max_drawdown != 0: + if max_drawdown != 0 and trade_count > 2000: calmar_ratio = expected_returns_mean / max_drawdown * msqrt(365) else: # Define high (negative) calmar ratio to be clear that this is NOT optimal.