From 8ad5afd3a1057ec4d118aef9ce21eb9d08851603 Mon Sep 17 00:00:00 2001 From: Cedric Schmeits Date: Thu, 8 Aug 2019 22:10:51 +0200 Subject: [PATCH] As -sharp_ratio is returned the value should be nagative. This leads in a high positive result of the loss function, as it is a minimal optimizer --- freqtrade/optimize/hyperopt_loss_sharpe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/optimize/hyperopt_loss_sharpe.py b/freqtrade/optimize/hyperopt_loss_sharpe.py index f74b27744..5631a75de 100644 --- a/freqtrade/optimize/hyperopt_loss_sharpe.py +++ b/freqtrade/optimize/hyperopt_loss_sharpe.py @@ -39,7 +39,7 @@ class SharpeHyperOptLoss(IHyperOptLoss): sharp_ratio = expected_yearly_return / np.std(total_profit) * np.sqrt(365) else: # Define high (negative) sharpe ratio to be clear that this is NOT optimal. - sharp_ratio = 20. + sharp_ratio = -20. # print(expected_yearly_return, np.std(total_profit), sharp_ratio) return -sharp_ratio