From 1f3ccc2587d8e8c8d4726906a483cb7ad6f456cb Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 26 Aug 2021 07:00:15 +0200 Subject: [PATCH] DefaultStrategy does not need to be limited --- config_examples/config_full.example.json | 2 +- docs/backtesting.md | 2 +- freqtrade/commands/cli_options.py | 2 +- freqtrade/commands/deploy_commands.py | 2 -- tests/commands/test_commands.py | 11 ----------- 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/config_examples/config_full.example.json b/config_examples/config_full.example.json index 3ca413281..d0f3f0df6 100644 --- a/config_examples/config_full.example.json +++ b/config_examples/config_full.example.json @@ -174,7 +174,7 @@ "heartbeat_interval": 60 }, "disable_dataframe_checks": false, - "strategy": "DefaultStrategy", + "strategy": "SampleStrategy", "strategy_path": "user_data/strategies/", "dataformat_ohlcv": "json", "dataformat_trades": "jsongz" diff --git a/docs/backtesting.md b/docs/backtesting.md index 89980c670..f750e0c4c 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -62,7 +62,7 @@ optional arguments: this together with `--export trades`, the strategy- name is injected into the filename (so `backtest- data.json` becomes `backtest-data- - DefaultStrategy.json` + SampleStrategy.json` --export {none,trades} Export backtest results (default: trades). --export-filename PATH diff --git a/freqtrade/commands/cli_options.py b/freqtrade/commands/cli_options.py index 215ed3f6e..42be5abd6 100644 --- a/freqtrade/commands/cli_options.py +++ b/freqtrade/commands/cli_options.py @@ -162,7 +162,7 @@ AVAILABLE_CLI_OPTIONS = { 'Please note that ticker-interval needs to be set either in config ' 'or via command line. When using this together with `--export trades`, ' 'the strategy-name is injected into the filename ' - '(so `backtest-data.json` becomes `backtest-data-DefaultStrategy.json`', + '(so `backtest-data.json` becomes `backtest-data-SampleStrategy.json`', nargs='+', ), "export": Arg( diff --git a/freqtrade/commands/deploy_commands.py b/freqtrade/commands/deploy_commands.py index eb65579e2..ec558e7b1 100644 --- a/freqtrade/commands/deploy_commands.py +++ b/freqtrade/commands/deploy_commands.py @@ -74,8 +74,6 @@ 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"]: - if args["strategy"] == "DefaultStrategy": - raise OperationalException("DefaultStrategy is not allowed as name.") new_path = config['user_data_dir'] / USERPATH_STRATEGIES / (args['strategy'] + '.py') diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index fc5101979..df2eb2c10 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -510,17 +510,6 @@ def test_start_new_strategy(mocker, caplog): start_new_strategy(get_args(args)) -def test_start_new_strategy_DefaultStrat(mocker, caplog): - args = [ - "new-strategy", - "--strategy", - "DefaultStrategy" - ] - with pytest.raises(OperationalException, - match=r"DefaultStrategy is not allowed as name\."): - start_new_strategy(get_args(args)) - - def test_start_new_strategy_no_arg(mocker, caplog): args = [ "new-strategy",