Remove hyperopt-loss default option
Force users to make a concious choice on a hyperopt-loss function
This commit is contained in:
@@ -258,10 +258,8 @@ AVAILABLE_CLI_OPTIONS = {
|
||||
'Different functions can generate completely different results, '
|
||||
'since the target for optimization is different. Built-in Hyperopt-loss-functions are: '
|
||||
'DefaultHyperOptLoss, OnlyProfitHyperOptLoss, SharpeHyperOptLoss, SharpeHyperOptLossDaily, '
|
||||
'SortinoHyperOptLoss, SortinoHyperOptLossDaily.'
|
||||
'(default: `%(default)s`).',
|
||||
'SortinoHyperOptLoss, SortinoHyperOptLossDaily.',
|
||||
metavar='NAME',
|
||||
default=constants.DEFAULT_HYPEROPT_LOSS,
|
||||
),
|
||||
"hyperoptexportfilename": Arg(
|
||||
'--hyperopt-filename',
|
||||
|
@@ -11,7 +11,6 @@ DEFAULT_EXCHANGE = 'bittrex'
|
||||
PROCESS_THROTTLE_SECS = 5 # sec
|
||||
HYPEROPT_EPOCH = 100 # epochs
|
||||
RETRY_TIMEOUT = 30 # sec
|
||||
DEFAULT_HYPEROPT_LOSS = 'DefaultHyperOptLoss'
|
||||
DEFAULT_DB_PROD_URL = 'sqlite:///tradesv3.sqlite'
|
||||
DEFAULT_DB_DRYRUN_URL = 'sqlite:///tradesv3.dryrun.sqlite'
|
||||
UNLIMITED_STAKE_AMOUNT = 'unlimited'
|
||||
|
@@ -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'))
|
||||
|
Reference in New Issue
Block a user