Improve error when hyperopt-loss-function is missing
This commit is contained in:
@@ -7,7 +7,7 @@ import logging
|
||||
from pathlib import Path
|
||||
from typing import Dict
|
||||
|
||||
from freqtrade.constants import USERPATH_HYPEROPTS
|
||||
from freqtrade.constants import HYPEROPT_LOSS_BUILTIN, USERPATH_HYPEROPTS
|
||||
from freqtrade.exceptions import OperationalException
|
||||
from freqtrade.optimize.hyperopt_interface import IHyperOpt
|
||||
from freqtrade.optimize.hyperopt_loss_interface import IHyperOptLoss
|
||||
@@ -72,8 +72,11 @@ class HyperOptLossResolver(IResolver):
|
||||
|
||||
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.")
|
||||
raise OperationalException(
|
||||
"No Hyperopt loss set. Please use `--hyperopt-loss` to "
|
||||
"specify the Hyperopt-Loss class to use.\n"
|
||||
f"Built-in Hyperopt-loss-functions are: {', '.join(HYPEROPT_LOSS_BUILTIN)}"
|
||||
)
|
||||
hyperoptloss = HyperOptLossResolver.load_object(hyperoptloss_name,
|
||||
config, kwargs={},
|
||||
extra_dir=config.get('hyperopt_path'))
|
||||
|
Reference in New Issue
Block a user