chore: remove long-deprecated "--hyperopt" argument

This commit is contained in:
Matthias
2025-10-29 17:57:51 +01:00
parent b2aa392a98
commit ff7b1e0edc
5 changed files with 2 additions and 23 deletions

View File

@@ -64,7 +64,6 @@ ARGS_BACKTEST = [
ARGS_HYPEROPT = [
*ARGS_COMMON_OPTIMIZE,
"hyperopt",
"hyperopt_path",
"position_stacking",
"enable_protections",

View File

@@ -2,7 +2,7 @@
Definition of cli arguments used in arguments.py
"""
from argparse import SUPPRESS, ArgumentTypeError
from argparse import ArgumentTypeError
from freqtrade import constants
from freqtrade.constants import HYPEROPT_LOSS_BUILTIN
@@ -256,12 +256,6 @@ AVAILABLE_CLI_OPTIONS = {
choices=constants.BACKTEST_CACHE_AGE,
),
# Hyperopt
"hyperopt": Arg(
"--hyperopt",
help=SUPPRESS,
metavar="NAME",
required=False,
),
"hyperopt_path": Arg(
"--hyperopt-path",
help="Specify additional lookup path for Hyperopt Loss functions.",

View File

@@ -336,7 +336,6 @@ class Configuration:
# Hyperopt section
configurations = [
("hyperopt", "Using Hyperopt class name: {}"),
("hyperopt_path", "Using additional Hyperopt lookup path: {}"),
("hyperoptexportfilename", "Using hyperopt file: {}"),
("lookahead_analysis_exportfilename", "Saving lookahead analysis results into {} ..."),

View File

@@ -18,7 +18,6 @@ from optuna.trial import FrozenTrial, Trial, TrialState
from freqtrade.constants import FTHYPT_FILEVERSION, LAST_BT_RESULT_FN, Config
from freqtrade.enums import HyperoptState
from freqtrade.exceptions import OperationalException
from freqtrade.misc import file_dump_json, plural
from freqtrade.optimize.hyperopt.hyperopt_optimizer import INITIAL_POINTS, HyperOptimizer
from freqtrade.optimize.hyperopt.hyperopt_output import HyperoptOutput
@@ -50,12 +49,6 @@ class Hyperopt:
self.analyze_per_epoch = self.config.get("analyze_per_epoch", False)
HyperoptStateContainer.set_state(HyperoptState.STARTUP)
if self.config.get("hyperopt"):
raise OperationalException(
"Using separate Hyperopt files has been removed in 2021.9. Please convert "
"your existing Hyperopt file to the new Hyperoptable strategy interface"
)
time_now = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
strategy = str(self.config["strategy"])
self.results_file: Path = (

View File

@@ -89,13 +89,7 @@ class HyperOptimizer:
self.custom_hyperopt: HyperOptAuto
self.analyze_per_epoch = self.config.get("analyze_per_epoch", False)
if not self.config.get("hyperopt"):
self.custom_hyperopt = HyperOptAuto(self.config)
else:
raise OperationalException(
"Using separate Hyperopt files has been removed in 2021.9. Please convert "
"your existing Hyperopt file to the new Hyperoptable strategy interface"
)
self.custom_hyperopt = HyperOptAuto(self.config)
self.backtesting._set_strategy(self.backtesting.strategylist[0])
self.custom_hyperopt.strategy = self.backtesting.strategy