feat: add list-hyperoptloss subcommand
This commit is contained in:
@@ -27,6 +27,7 @@ from freqtrade.commands.hyperopt_commands import start_hyperopt_list, start_hype
|
|||||||
from freqtrade.commands.list_commands import (
|
from freqtrade.commands.list_commands import (
|
||||||
start_list_exchanges,
|
start_list_exchanges,
|
||||||
start_list_freqAI_models,
|
start_list_freqAI_models,
|
||||||
|
start_list_hyperopt_loss_functions,
|
||||||
start_list_markets,
|
start_list_markets,
|
||||||
start_list_strategies,
|
start_list_strategies,
|
||||||
start_list_timeframes,
|
start_list_timeframes,
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ NO_CONF_REQURIED = [
|
|||||||
"list-pairs",
|
"list-pairs",
|
||||||
"list-strategies",
|
"list-strategies",
|
||||||
"list-freqaimodels",
|
"list-freqaimodels",
|
||||||
|
"list-hyperoptloss",
|
||||||
"list-data",
|
"list-data",
|
||||||
"hyperopt-list",
|
"hyperopt-list",
|
||||||
"hyperopt-show",
|
"hyperopt-show",
|
||||||
@@ -365,6 +366,7 @@ class Arguments:
|
|||||||
start_list_data,
|
start_list_data,
|
||||||
start_list_exchanges,
|
start_list_exchanges,
|
||||||
start_list_freqAI_models,
|
start_list_freqAI_models,
|
||||||
|
start_list_hyperopt_loss_functions,
|
||||||
start_list_markets,
|
start_list_markets,
|
||||||
start_list_strategies,
|
start_list_strategies,
|
||||||
start_list_timeframes,
|
start_list_timeframes,
|
||||||
@@ -566,6 +568,15 @@ class Arguments:
|
|||||||
list_strategies_cmd.set_defaults(func=start_list_strategies)
|
list_strategies_cmd.set_defaults(func=start_list_strategies)
|
||||||
self._build_args(optionlist=ARGS_LIST_STRATEGIES, parser=list_strategies_cmd)
|
self._build_args(optionlist=ARGS_LIST_STRATEGIES, parser=list_strategies_cmd)
|
||||||
|
|
||||||
|
# Add list-Hyperopt loss subcommand
|
||||||
|
list_hyperopt_loss_cmd = subparsers.add_parser(
|
||||||
|
"list-hyperoptloss",
|
||||||
|
help="Print available hyperopt loss functions.",
|
||||||
|
parents=[_common_parser],
|
||||||
|
)
|
||||||
|
list_hyperopt_loss_cmd.set_defaults(func=start_list_hyperopt_loss_functions)
|
||||||
|
self._build_args(optionlist=ARGS_LIST_HYPEROPTS, parser=list_hyperopt_loss_cmd)
|
||||||
|
|
||||||
# Add list-freqAI Models subcommand
|
# Add list-freqAI Models subcommand
|
||||||
list_freqaimodels_cmd = subparsers.add_parser(
|
list_freqaimodels_cmd = subparsers.add_parser(
|
||||||
"list-freqaimodels",
|
"list-freqaimodels",
|
||||||
|
|||||||
@@ -169,6 +169,24 @@ def start_list_freqAI_models(args: dict[str, Any]) -> None:
|
|||||||
_print_objs_tabular(model_objs, config.get("print_colorized", False))
|
_print_objs_tabular(model_objs, config.get("print_colorized", False))
|
||||||
|
|
||||||
|
|
||||||
|
def start_list_hyperopt_loss_functions(args: dict[str, Any]) -> None:
|
||||||
|
"""
|
||||||
|
Print files with FreqAI models custom classes available in the directory
|
||||||
|
"""
|
||||||
|
from freqtrade.configuration import setup_utils_configuration
|
||||||
|
from freqtrade.resolvers.hyperopt_resolver import HyperOptLossResolver
|
||||||
|
|
||||||
|
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
|
||||||
|
|
||||||
|
model_objs = HyperOptLossResolver.search_all_objects(config, not args["print_one_column"])
|
||||||
|
# Sort alphabetically
|
||||||
|
model_objs = sorted(model_objs, key=lambda x: x["name"])
|
||||||
|
if args["print_one_column"]:
|
||||||
|
print("\n".join([s["name"] for s in model_objs]))
|
||||||
|
else:
|
||||||
|
_print_objs_tabular(model_objs, config.get("print_colorized", False))
|
||||||
|
|
||||||
|
|
||||||
def start_list_timeframes(args: dict[str, Any]) -> None:
|
def start_list_timeframes(args: dict[str, Any]) -> None:
|
||||||
"""
|
"""
|
||||||
Print timeframes available on Exchange
|
Print timeframes available on Exchange
|
||||||
|
|||||||
Reference in New Issue
Block a user