Merge pull request #2033 from hroff-1902/remove-dynamic-whitelist-option
remove deprecated --dynamic-whitelist option
This commit is contained in:
@@ -73,16 +73,6 @@ AVAILABLE_CLI_OPTIONS = {
|
||||
help='Specify additional strategy lookup path.',
|
||||
metavar='PATH',
|
||||
),
|
||||
"dynamic_whitelist": Arg(
|
||||
'--dynamic-whitelist',
|
||||
help='Dynamically generate and update whitelist '
|
||||
'based on 24h BaseVolume (default: %(const)s). '
|
||||
'DEPRECATED.',
|
||||
const=constants.DYNAMIC_WHITELIST,
|
||||
type=int,
|
||||
metavar='INT',
|
||||
nargs='?',
|
||||
),
|
||||
"db_url": Arg(
|
||||
'--db-url',
|
||||
help=f'Override trades database URL, this is useful in custom deployments '
|
||||
@@ -299,7 +289,7 @@ ARGS_COMMON = ["verbosity", "logfile", "version", "config", "datadir"]
|
||||
|
||||
ARGS_STRATEGY = ["strategy", "strategy_path"]
|
||||
|
||||
ARGS_MAIN = ARGS_COMMON + ARGS_STRATEGY + ["dynamic_whitelist", "db_url", "sd_notify"]
|
||||
ARGS_MAIN = ARGS_COMMON + ARGS_STRATEGY + ["db_url", "sd_notify"]
|
||||
|
||||
ARGS_COMMON_OPTIMIZE = ["ticker_interval", "timerange",
|
||||
"max_open_trades", "stake_amount", "refresh_pairs"]
|
||||
|
@@ -137,19 +137,6 @@ class Configuration(object):
|
||||
self._process_logging_options(config)
|
||||
self._process_strategy_options(config)
|
||||
|
||||
# Add dynamic_whitelist if found
|
||||
if 'dynamic_whitelist' in self.args and self.args.dynamic_whitelist:
|
||||
# Update to volumePairList (the previous default)
|
||||
config['pairlist'] = {'method': 'VolumePairList',
|
||||
'config': {'number_assets': self.args.dynamic_whitelist}
|
||||
}
|
||||
logger.warning(
|
||||
'Parameter --dynamic-whitelist has been deprecated, '
|
||||
'and will be completely replaced by the whitelist dict in the future. '
|
||||
'For now: using dynamically generated whitelist based on VolumePairList. '
|
||||
'(not applicable with Backtesting and Hyperopt)'
|
||||
)
|
||||
|
||||
if ('db_url' in self.args and self.args.db_url and
|
||||
self.args.db_url != constants.DEFAULT_DB_PROD_URL):
|
||||
config.update({'db_url': self.args.db_url})
|
||||
|
@@ -86,21 +86,6 @@ def test_parse_args_strategy_path_invalid() -> None:
|
||||
Arguments(['--strategy-path'], '').get_parsed_arg()
|
||||
|
||||
|
||||
def test_parse_args_dynamic_whitelist() -> None:
|
||||
args = Arguments(['--dynamic-whitelist'], '').get_parsed_arg()
|
||||
assert args.dynamic_whitelist == 20
|
||||
|
||||
|
||||
def test_parse_args_dynamic_whitelist_10() -> None:
|
||||
args = Arguments(['--dynamic-whitelist', '10'], '').get_parsed_arg()
|
||||
assert args.dynamic_whitelist == 10
|
||||
|
||||
|
||||
def test_parse_args_dynamic_whitelist_invalid_values() -> None:
|
||||
with pytest.raises(SystemExit, match=r'2'):
|
||||
Arguments(['--dynamic-whitelist', 'abc'], '').get_parsed_arg()
|
||||
|
||||
|
||||
def test_parse_timerange_incorrect() -> None:
|
||||
assert TimeRange(None, 'line', 0, -200) == Arguments.parse_timerange('-200')
|
||||
assert TimeRange('line', None, 200, 0) == Arguments.parse_timerange('200-')
|
||||
|
@@ -149,7 +149,6 @@ def test_load_config_with_params(default_conf, mocker) -> None:
|
||||
patched_configuration_load_config_file(mocker, default_conf)
|
||||
|
||||
arglist = [
|
||||
'--dynamic-whitelist', '10',
|
||||
'--strategy', 'TestStrategy',
|
||||
'--strategy-path', '/some/path',
|
||||
'--db-url', 'sqlite:///someurl',
|
||||
@@ -158,8 +157,6 @@ def test_load_config_with_params(default_conf, mocker) -> None:
|
||||
configuration = Configuration(args)
|
||||
validated_conf = configuration.load_config()
|
||||
|
||||
assert validated_conf.get('pairlist', {}).get('method') == 'VolumePairList'
|
||||
assert validated_conf.get('pairlist', {}).get('config').get('number_assets') == 10
|
||||
assert validated_conf.get('strategy') == 'TestStrategy'
|
||||
assert validated_conf.get('strategy_path') == '/some/path'
|
||||
assert validated_conf.get('db_url') == 'sqlite:///someurl'
|
||||
@@ -250,7 +247,6 @@ def test_show_info(default_conf, mocker, caplog) -> None:
|
||||
patched_configuration_load_config_file(mocker, default_conf)
|
||||
|
||||
arglist = [
|
||||
'--dynamic-whitelist', '10',
|
||||
'--strategy', 'TestStrategy',
|
||||
'--db-url', 'sqlite:///tmp/testdb',
|
||||
]
|
||||
@@ -259,13 +255,6 @@ def test_show_info(default_conf, mocker, caplog) -> None:
|
||||
configuration = Configuration(args)
|
||||
configuration.get_config()
|
||||
|
||||
assert log_has(
|
||||
'Parameter --dynamic-whitelist has been deprecated, '
|
||||
'and will be completely replaced by the whitelist dict in the future. '
|
||||
'For now: using dynamically generated whitelist based on VolumePairList. '
|
||||
'(not applicable with Backtesting and Hyperopt)',
|
||||
caplog.record_tuples
|
||||
)
|
||||
assert log_has('Using DB: "sqlite:///tmp/testdb"', caplog.record_tuples)
|
||||
assert log_has('Dry run is enabled', caplog.record_tuples)
|
||||
|
||||
|
Reference in New Issue
Block a user