From fed75d8718303b837f5192711f9a68189a9c7efa Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 16 May 2020 13:23:40 +0200 Subject: [PATCH] remove --cancel_open_orders cli switch --- freqtrade/commands/arguments.py | 2 +- freqtrade/commands/cli_options.py | 5 ----- freqtrade/configuration/configuration.py | 5 ----- tests/test_arguments.py | 8 -------- tests/test_configuration.py | 2 -- 5 files changed, 1 insertion(+), 21 deletions(-) diff --git a/freqtrade/commands/arguments.py b/freqtrade/commands/arguments.py index 234b719f7..a03da00ab 100644 --- a/freqtrade/commands/arguments.py +++ b/freqtrade/commands/arguments.py @@ -13,7 +13,7 @@ ARGS_COMMON = ["verbosity", "logfile", "version", "config", "datadir", "user_dat ARGS_STRATEGY = ["strategy", "strategy_path"] -ARGS_TRADE = ["db_url", "sd_notify", "dry_run", "cancel_open_orders_on_exit"] +ARGS_TRADE = ["db_url", "sd_notify", "dry_run"] ARGS_COMMON_OPTIMIZE = ["ticker_interval", "timerange", "max_open_trades", "stake_amount", "fee"] diff --git a/freqtrade/commands/cli_options.py b/freqtrade/commands/cli_options.py index 7a2110a91..a8f2ffdba 100644 --- a/freqtrade/commands/cli_options.py +++ b/freqtrade/commands/cli_options.py @@ -109,11 +109,6 @@ AVAILABLE_CLI_OPTIONS = { help='Enforce dry-run for trading (removes Exchange secrets and simulates trades).', action='store_true', ), - "cancel_open_orders_on_exit": Arg( - '--cancel-open-orders-on-exit', - help='Close unfilled and partially filled open orders when the bot stops / exits.', - action='store_true', - ), # Optimize common "ticker_interval": Arg( '-i', '--ticker-interval', diff --git a/freqtrade/configuration/configuration.py b/freqtrade/configuration/configuration.py index 188d79f90..7edd9bca1 100644 --- a/freqtrade/configuration/configuration.py +++ b/freqtrade/configuration/configuration.py @@ -134,11 +134,6 @@ class Configuration: if config['runmode'] not in TRADING_MODES: return - if self.args.get('cancel_open_orders_on_exit', False): - config.update({ - 'cancel_open_orders_on_exit': self.args.get('cancel_open_orders_on_exit') - }) - if config.get('dry_run', False): logger.info('Dry run is enabled') if config.get('db_url') in [None, constants.DEFAULT_DB_PROD_URL]: diff --git a/tests/test_arguments.py b/tests/test_arguments.py index 91501384b..0052a61d0 100644 --- a/tests/test_arguments.py +++ b/tests/test_arguments.py @@ -64,14 +64,6 @@ def test_parse_args_db_url() -> None: assert args["db_url"] == 'sqlite:///test.sqlite' -def test_parse_args_cancel_open_orders_on_exit() -> None: - args = Arguments(['trade']).get_parsed_arg() - assert args["cancel_open_orders_on_exit"] is False - - args = Arguments(['trade', '--cancel-open-orders-on-exit']).get_parsed_arg() - assert args["cancel_open_orders_on_exit"] is True - - def test_parse_args_verbose() -> None: args = Arguments(['trade', '-v']).get_parsed_arg() assert args["verbosity"] == 1 diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 0315ffe1b..c89f1381e 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -250,7 +250,6 @@ def test_load_config_with_params(default_conf, mocker) -> None: '--strategy', 'TestStrategy', '--strategy-path', '/some/path', '--db-url', 'sqlite:///someurl', - '--cancel-open-orders-on-exit', ] args = Arguments(arglist).get_parsed_arg() configuration = Configuration(args) @@ -259,7 +258,6 @@ def test_load_config_with_params(default_conf, mocker) -> None: assert validated_conf.get('strategy') == 'TestStrategy' assert validated_conf.get('strategy_path') == '/some/path' assert validated_conf.get('db_url') == 'sqlite:///someurl' - assert validated_conf.get('cancel_open_orders_on_exit') is True # Test conf provided db_url prod conf = default_conf.copy()