Add --dry-run to trade command

This commit is contained in:
Matthias
2019-10-15 06:51:03 +02:00
parent 2c200873c1
commit a5c83b66df
5 changed files with 30 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ ARGS_COMMON = ["verbosity", "logfile", "version", "config", "datadir", "user_dat
ARGS_STRATEGY = ["strategy", "strategy_path"]
ARGS_TRADE = ["db_url", "sd_notify"]
ARGS_TRADE = ["db_url", "sd_notify", "dry_run"]
ARGS_COMMON_OPTIMIZE = ["ticker_interval", "timerange", "max_open_trades", "stake_amount"]

View File

@@ -86,6 +86,11 @@ AVAILABLE_CLI_OPTIONS = {
help='Notify systemd service manager.',
action='store_true',
),
"dry_run": Arg(
'--dry-run',
help='Enforce dry-run for trading, removes API keys and simulates trades.',
action='store_true',
),
# Optimize common
"ticker_interval": Arg(
'-i', '--ticker-interval',

View File

@@ -162,6 +162,10 @@ class Configuration:
if 'sd_notify' in self.args and self.args["sd_notify"]:
config['internals'].update({'sd_notify': True})
self._args_to_config(config, argname='dry_run',
logstring='Parameter --dry-run detected, '
'overriding dry_run to: {} ...')
def _process_datadir_options(self, config: Dict[str, Any]) -> None:
"""
Extract information for sys.argv and load directory configurations