From 68dea691c2f20305348ef5e4e14fbb3c31252f06 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 5 Nov 2025 20:53:12 +0100 Subject: [PATCH] chore: improve help wording --- docs/commands/hyperopt.md | 9 +++++---- freqtrade/commands/cli_options.py | 14 ++++++++++---- freqtrade/constants.py | 3 +-- freqtrade/optimize/hyperopt_tools.py | 1 + 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/docs/commands/hyperopt.md b/docs/commands/hyperopt.md index 0a93deae6..9348e15da 100644 --- a/docs/commands/hyperopt.md +++ b/docs/commands/hyperopt.md @@ -55,10 +55,11 @@ options: -e INT, --epochs INT Specify number of epochs (default: 100). --spaces SPACES [SPACES ...] Specify which parameters to hyperopt. Space-separated - list. Available options: all, buy, sell, roi, - stoploss, trailing, protection, trades, default. - Default: `default` - which includes all spaces except - for 'trailing', 'protection', and 'trades'. + list. Available builtin options (custom spaces will + not be listed here): default, all, buy, sell, roi, + stoploss, trailing, protection, trades. Default: + `default` - which includes all spaces except for + 'trailing', 'protection', and 'trades'. --print-all Print all results, not only the best ones. --print-json Print output in JSON format. -j JOBS, --job-workers JOBS diff --git a/freqtrade/commands/cli_options.py b/freqtrade/commands/cli_options.py index 1c1a9614f..c256c46f3 100755 --- a/freqtrade/commands/cli_options.py +++ b/freqtrade/commands/cli_options.py @@ -5,7 +5,10 @@ Definition of cli arguments used in arguments.py from argparse import ArgumentTypeError from freqtrade import constants -from freqtrade.constants import HYPEROPT_BUILTIN_SPACES, HYPEROPT_LOSS_BUILTIN +from freqtrade.constants import ( + HYPEROPT_BUILTIN_SPACE_OPTIONS, + HYPEROPT_LOSS_BUILTIN, +) from freqtrade.enums import CandleType @@ -278,9 +281,12 @@ AVAILABLE_CLI_OPTIONS = { ), "spaces": Arg( "--spaces", - help="Specify which parameters to hyperopt. Space-separated list. Available options: " - f"{', '.join(HYPEROPT_BUILTIN_SPACES)}. Default: `default` - " - "which includes all spaces except for 'trailing', 'protection', and 'trades'.", + help=( + "Specify which parameters to hyperopt. Space-separated list. " + "Available builtin options (custom spaces will not be listed here): " + f"{', '.join(HYPEROPT_BUILTIN_SPACE_OPTIONS)}. Default: `default` - " + "which includes all spaces except for 'trailing', 'protection', and 'trades'." + ), nargs="+", ), "analyze_per_epoch": Arg( diff --git a/freqtrade/constants.py b/freqtrade/constants.py index c25895957..a386dba28 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -42,7 +42,6 @@ HYPEROPT_LOSS_BUILTIN = [ "MultiMetricHyperOptLoss", ] HYPEROPT_BUILTIN_SPACES = [ - "all", "buy", "sell", "roi", @@ -50,8 +49,8 @@ HYPEROPT_BUILTIN_SPACES = [ "trailing", "protection", "trades", - "default", ] +HYPEROPT_BUILTIN_SPACE_OPTIONS = ["default", "all"] + HYPEROPT_BUILTIN_SPACES AVAILABLE_PAIRLISTS = [ "StaticPairList", diff --git a/freqtrade/optimize/hyperopt_tools.py b/freqtrade/optimize/hyperopt_tools.py index d343f6ee5..fbf6448f2 100644 --- a/freqtrade/optimize/hyperopt_tools.py +++ b/freqtrade/optimize/hyperopt_tools.py @@ -220,6 +220,7 @@ class HyperoptTools: else: all_spaces = list(params.keys() | non_optimized.keys()) + # Explicitly listed to keep original sort order spaces = ["buy", "sell", "protection", "roi", "stoploss", "trailing", "max_open_trades"] spaces += [s for s in all_spaces if s not in spaces] lookup = {