mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-08 07:10:28 +00:00
feat: add support for --strategy-path to new-strategy
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user