fix --stake-amount parameter

This commit is contained in:
Matthias
2021-02-25 20:14:33 +01:00
parent d3fb473e57
commit 86f9409fd2
3 changed files with 11 additions and 2 deletions

View File

@@ -133,7 +133,6 @@ AVAILABLE_CLI_OPTIONS = {
"stake_amount": Arg(
'--stake-amount',
help='Override the value of the `stake_amount` configuration setting.',
type=float,
),
# Backtesting
"position_stacking": Arg(

View File

@@ -229,6 +229,13 @@ class Configuration:
elif config['runmode'] in NON_UTIL_MODES:
logger.info('Using max_open_trades: %s ...', config.get('max_open_trades'))
if self.args.get('stake_amount', None):
# Convert explicitly to float to support CLI argument for both unlimited and value
try:
self.args['stake_amount'] = float(self.args['stake_amount'])
except ValueError:
pass
self._args_to_config(config, argname='stake_amount',
logstring='Parameter --stake-amount detected, '
'overriding stake_amount to: {} ...')