Remove hyperopt-loss default option

Force users to make a concious choice on a hyperopt-loss function
This commit is contained in:
Matthias
2020-10-05 19:27:28 +02:00
parent 584d095295
commit 378b214a56
9 changed files with 17 additions and 23 deletions

View File

@@ -7,7 +7,7 @@ import logging
from pathlib import Path
from typing import Dict
from freqtrade.constants import DEFAULT_HYPEROPT_LOSS, USERPATH_HYPEROPTS
from freqtrade.constants import USERPATH_HYPEROPTS
from freqtrade.exceptions import OperationalException
from freqtrade.optimize.hyperopt_interface import IHyperOpt
from freqtrade.optimize.hyperopt_loss_interface import IHyperOptLoss
@@ -70,10 +70,10 @@ class HyperOptLossResolver(IResolver):
:param config: configuration dictionary
"""
# Verify the hyperopt_loss is in the configuration, otherwise fallback to the
# default hyperopt loss
hyperoptloss_name = config.get('hyperopt_loss') or DEFAULT_HYPEROPT_LOSS
hyperoptloss_name = config.get('hyperopt_loss')
if not hyperoptloss_name:
raise OperationalException("No Hyperopt loss set. Please use `--hyperopt-loss` to "
"specify the Hyperopt-Loss class to use.")
hyperoptloss = HyperOptLossResolver.load_object(hyperoptloss_name,
config, kwargs={},
extra_dir=config.get('hyperopt_path'))