diff --git a/docs/hyperopt.md b/docs/hyperopt.md index 4108946c2..74d03b8ab 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -186,6 +186,7 @@ class SuperDuperHyperOptLoss(IHyperOptLoss): Weights are distributed as follows: * 0.4 to trade duration * 0.25: Avoiding trade loss + * 1.0 to total profit, compared to the expected value (`EXPECTED_MAX_PROFIT`) defined above """ total_profit = results.profit_percent.sum() trade_duration = results.trade_duration.mean() diff --git a/freqtrade/optimize/default_hyperopt_loss.py b/freqtrade/optimize/default_hyperopt_loss.py index 60faa9f61..58be44ab9 100644 --- a/freqtrade/optimize/default_hyperopt_loss.py +++ b/freqtrade/optimize/default_hyperopt_loss.py @@ -37,10 +37,11 @@ class DefaultHyperOptLoss(IHyperOptLoss): *args, **kwargs) -> float: """ Objective function, returns smaller number for better results - This is the legacy algorithm (used until now in freqtrade). + This is the Default algorithm Weights are distributed as follows: * 0.4 to trade duration * 0.25: Avoiding trade loss + * 1.0 to total profit, compared to the expected value (`EXPECTED_MAX_PROFIT`) defined above """ total_profit = results.profit_percent.sum() trade_duration = results.trade_duration.mean() diff --git a/user_data/hyperopts/sample_hyperopt.py b/user_data/hyperopts/sample_hyperopt.py index 6428a1843..8650d0a98 100644 --- a/user_data/hyperopts/sample_hyperopt.py +++ b/user_data/hyperopts/sample_hyperopt.py @@ -42,21 +42,6 @@ class SampleHyperOpts(IHyperOpt): roi_space, generate_roi_table, stoploss_space """ - @staticmethod - def hyperopt_loss_custom(results: DataFrame, trade_count: int, - min_date: datetime, max_date: datetime, *args, **kwargs) -> float: - """ - Objective function, returns smaller number for more optimal results - """ - total_profit = results.profit_percent.sum() - trade_duration = results.trade_duration.mean() - - trade_loss = 1 - 0.25 * exp(-(trade_count - TARGET_TRADES) ** 2 / 10 ** 5.8) - profit_loss = max(0, 1 - total_profit / EXPECTED_MAX_PROFIT) - duration_loss = 0.4 * min(trade_duration / MAX_ACCEPTED_TRADE_DURATION, 1) - result = trade_loss + profit_loss + duration_loss - return result - @staticmethod def populate_indicators(dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe['adx'] = ta.ADX(dataframe)