Fail download-data gracefully if no pairs-file exists

This commit is contained in:
Matthias
2019-09-21 12:53:15 +02:00
parent 3245ebccd4
commit 7aa42f8868
2 changed files with 28 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ from typing import Any, Dict, List
import arrow
from freqtrade import OperationalException
from freqtrade.configuration import Configuration, TimeRange
from freqtrade.configuration.directory_operations import create_userdata_dir
from freqtrade.data.history import refresh_backtest_ohlcv_data
@@ -70,6 +71,11 @@ def start_download_data(args: Dict[str, Any]) -> None:
time_since = arrow.utcnow().shift(days=-config['days']).strftime("%Y%m%d")
timerange = TimeRange.parse_timerange(f'{time_since}-')
if 'pairs' not in config:
raise OperationalException(
"Downloading data requires a list of pairs."
"Please check the documentation on how to configure this.")
dl_path = Path(config['datadir'])
logger.info(f'About to download pairs: {config["pairs"]}, '
f'intervals: {config["timeframes"]} to {dl_path}')