support for multiple --config in the download_backtest_data.py utility
This commit is contained in:
parent
c08a2b6638
commit
87c82dea3d
@ -384,10 +384,10 @@ class Arguments(object):
|
||||
|
||||
self.parser.add_argument(
|
||||
'-c', '--config',
|
||||
help='Specify configuration file, used for additional exchange parameters. '
|
||||
help='Specify configuration file (default: %(default)s). '
|
||||
'Multiple --config options may be used.',
|
||||
dest='config',
|
||||
default=None,
|
||||
action='append',
|
||||
type=str,
|
||||
metavar='PATH',
|
||||
)
|
||||
|
@ -5,12 +5,14 @@ import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
import arrow
|
||||
from typing import Any, Dict
|
||||
|
||||
from freqtrade import arguments
|
||||
from freqtrade.arguments import Arguments
|
||||
from freqtrade.arguments import TimeRange
|
||||
from freqtrade.exchange import Exchange
|
||||
from freqtrade.data.history import download_pair_history
|
||||
from freqtrade.configuration import Configuration, set_loggers
|
||||
from freqtrade.misc import deep_merge_dicts
|
||||
|
||||
import logging
|
||||
logging.basicConfig(
|
||||
@ -21,7 +23,7 @@ set_loggers(0)
|
||||
|
||||
DEFAULT_DL_PATH = 'user_data/data'
|
||||
|
||||
arguments = arguments.Arguments(sys.argv[1:], 'download utility')
|
||||
arguments = Arguments(sys.argv[1:], 'download utility')
|
||||
arguments.testdata_dl_options()
|
||||
args = arguments.parse_args()
|
||||
|
||||
@ -29,7 +31,15 @@ timeframes = args.timeframes
|
||||
|
||||
if args.config:
|
||||
configuration = Configuration(args)
|
||||
config = configuration._load_config_file(args.config)
|
||||
|
||||
config: Dict[str, Any] = {}
|
||||
# Now expecting a list of config filenames here, not a string
|
||||
for path in args.config:
|
||||
print('Using config: %s ...', path)
|
||||
# Merge config options, overwriting old values
|
||||
config = deep_merge_dicts(configuration._load_config_file(path), config)
|
||||
|
||||
### config = configuration._load_config_file(args.config)
|
||||
|
||||
config['stake_currency'] = ''
|
||||
# Ensure we do not use Exchange credentials
|
||||
|
Loading…
Reference in New Issue
Block a user