Merge pull request #1430 from freqtrade/download_data_config
Download data config
This commit is contained in:
commit
8e5ea8620b
@ -378,6 +378,15 @@ class Arguments(object):
|
||||
metavar='PATH',
|
||||
)
|
||||
|
||||
self.parser.add_argument(
|
||||
'-c', '--config',
|
||||
help='specify configuration file, used for additional exchange parameters',
|
||||
dest='config',
|
||||
default=None,
|
||||
type=str,
|
||||
metavar='PATH',
|
||||
)
|
||||
|
||||
self.parser.add_argument(
|
||||
'--days',
|
||||
help='Download data for number of days',
|
||||
@ -389,7 +398,7 @@ class Arguments(object):
|
||||
|
||||
self.parser.add_argument(
|
||||
'--exchange',
|
||||
help='Exchange name (default: %(default)s)',
|
||||
help='Exchange name (default: %(default)s). Only valid if no config is provided',
|
||||
dest='exchange',
|
||||
type=str,
|
||||
default='bittrex'
|
||||
|
@ -10,7 +10,7 @@ from freqtrade import arguments
|
||||
from freqtrade.arguments import TimeRange
|
||||
from freqtrade.exchange import Exchange
|
||||
from freqtrade.data.history import download_pair_history
|
||||
from freqtrade.configuration import set_loggers
|
||||
from freqtrade.configuration import Configuration, set_loggers
|
||||
|
||||
import logging
|
||||
logging.basicConfig(
|
||||
@ -27,7 +27,29 @@ args = arguments.parse_args()
|
||||
|
||||
timeframes = args.timeframes
|
||||
|
||||
dl_path = Path(DEFAULT_DL_PATH).joinpath(args.exchange)
|
||||
if args.config:
|
||||
configuration = Configuration(args)
|
||||
config = configuration._load_config_file(args.config)
|
||||
|
||||
# Ensure we do not use Exchange credentials
|
||||
config['exchange']['key'] = ''
|
||||
config['exchange']['secret'] = ''
|
||||
else:
|
||||
config = {'stake_currency': '',
|
||||
'dry_run': True,
|
||||
'exchange': {
|
||||
'name': args.exchange,
|
||||
'key': '',
|
||||
'secret': '',
|
||||
'pair_whitelist': [],
|
||||
'ccxt_async_config': {
|
||||
"enableRateLimit": False
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dl_path = Path(DEFAULT_DL_PATH).joinpath(config['exchange']['name'])
|
||||
if args.export:
|
||||
dl_path = Path(args.export)
|
||||
|
||||
@ -52,20 +74,8 @@ if args.days:
|
||||
|
||||
print(f'About to download pairs: {PAIRS} to {dl_path}')
|
||||
|
||||
|
||||
# Init exchange
|
||||
exchange = Exchange({'key': '',
|
||||
'secret': '',
|
||||
'stake_currency': '',
|
||||
'dry_run': True,
|
||||
'exchange': {
|
||||
'name': args.exchange,
|
||||
'pair_whitelist': [],
|
||||
'ccxt_async_config': {
|
||||
"enableRateLimit": False
|
||||
}
|
||||
}
|
||||
})
|
||||
exchange = Exchange(config)
|
||||
pairs_not_available = []
|
||||
|
||||
for pair in PAIRS:
|
||||
|
Loading…
Reference in New Issue
Block a user