diff --git a/freqtrade/commands/arguments.py b/freqtrade/commands/arguments.py index 3090bb8e0..a56185471 100755 --- a/freqtrade/commands/arguments.py +++ b/freqtrade/commands/arguments.py @@ -115,7 +115,7 @@ ARGS_CREATE_USERDIR = ["user_data_dir", "reset"] ARGS_BUILD_CONFIG = ["config"] ARGS_SHOW_CONFIG = ["user_data_dir", "config", "show_sensitive"] -ARGS_BUILD_STRATEGY = ["user_data_dir", "strategy", "template"] +ARGS_BUILD_STRATEGY = ["user_data_dir", "strategy", "strategy_path", "template"] ARGS_CONVERT_DATA_TRADES = ["pairs", "format_from_trades", "format_to", "erase", "exchange"] ARGS_CONVERT_DATA = ["pairs", "format_from", "format_to", "erase", "exchange"] diff --git a/freqtrade/commands/deploy_commands.py b/freqtrade/commands/deploy_commands.py index 0d188e514..11e96a2ac 100644 --- a/freqtrade/commands/deploy_commands.py +++ b/freqtrade/commands/deploy_commands.py @@ -86,7 +86,11 @@ def start_new_strategy(args: dict[str, Any]) -> None: config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE) if "strategy" in args and args["strategy"]: - new_path = config["user_data_dir"] / USERPATH_STRATEGIES / (args["strategy"] + ".py") + if "strategy_path" in args and args["strategy_path"]: + strategy_dir = Path(args["strategy_path"]) + else: + strategy_dir = config["user_data_dir"] / USERPATH_STRATEGIES + new_path = strategy_dir / (args["strategy"] + ".py") if new_path.exists(): raise OperationalException(