exportfilename should respect configured user_data_dir

This commit is contained in:
Matthias 2019-10-19 11:13:10 +02:00
parent 93b213ae0b
commit b152585d9b
2 changed files with 7 additions and 6 deletions

View File

@ -2,7 +2,6 @@
Definition of cli arguments used in arguments.py Definition of cli arguments used in arguments.py
""" """
import argparse import argparse
import os
from freqtrade import __version__, constants from freqtrade import __version__, constants
@ -141,8 +140,6 @@ AVAILABLE_CLI_OPTIONS = {
'Requires `--export` to be set as well. ' 'Requires `--export` to be set as well. '
'Example: `--export-filename=user_data/backtest_results/backtest_today.json`', 'Example: `--export-filename=user_data/backtest_results/backtest_today.json`',
metavar='PATH', metavar='PATH',
default=os.path.join('user_data', 'backtest_results',
'backtest-result.json'),
), ),
"fee": Arg( "fee": Arg(
'--fee', '--fee',

View File

@ -192,6 +192,13 @@ class Configuration:
config.update({'datadir': create_datadir(config, self.args.get("datadir", None))}) config.update({'datadir': create_datadir(config, self.args.get("datadir", None))})
logger.info('Using data directory: %s ...', config.get('datadir')) logger.info('Using data directory: %s ...', config.get('datadir'))
if self.args.get('exportfilename'):
self._args_to_config(config, argname='exportfilename',
logstring='Storing backtest results to {} ...')
else:
config['exportfilename'] = (config['user_data_dir']
/ 'backtest_results/backtest-result.json')
def _process_optimize_options(self, config: Dict[str, Any]) -> None: def _process_optimize_options(self, config: Dict[str, Any]) -> None:
# This will override the strategy configuration # This will override the strategy configuration
@ -235,9 +242,6 @@ class Configuration:
self._args_to_config(config, argname='export', self._args_to_config(config, argname='export',
logstring='Parameter --export detected: {} ...') logstring='Parameter --export detected: {} ...')
self._args_to_config(config, argname='exportfilename',
logstring='Storing backtest results to {} ...')
# Edge section: # Edge section:
if 'stoploss_range' in self.args and self.args["stoploss_range"]: if 'stoploss_range' in self.args and self.args["stoploss_range"]:
txt_range = eval(self.args["stoploss_range"]) txt_range = eval(self.args["stoploss_range"])