Adjust some tests - implement new "live" method to plot_script

This commit is contained in:
Matthias
2019-05-29 20:25:07 +02:00
parent c2f6897d8b
commit 15984b5c43
4 changed files with 49 additions and 24 deletions

View File

@@ -129,11 +129,16 @@ def load_data(datadir: Optional[Path],
Loads ticker history data for a list of pairs the given parameters
:return: dict(<pair>:<tickerlist>)
"""
result = {}
result: Dict[str, DataFrame] = {}
if live:
logger.info('Live: Downloading data for all defined pairs ...')
exchange.refresh_latest_ohlcv([(pair, ticker_interval) for pair in pairs])
result = {key[0]: value for key, value in exchange._klines.items() if value is not None}
if exchange:
logger.info('Live: Downloading data for all defined pairs ...')
exchange.refresh_latest_ohlcv([(pair, ticker_interval) for pair in pairs])
result = {key[0]: value for key, value in exchange._klines.items() if value is not None}
else:
raise OperationalException(
"Exchange needs to be initialized when using live data."
)
else:
logger.info('Using local backtesting data ...')