From a852d2ff32627ac1ffc56e3038319d5511f675c0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 10 Aug 2018 11:15:02 +0200 Subject: [PATCH] default since_ms to 30 days if no timerange is given --- freqtrade/exchange/__init__.py | 2 +- freqtrade/optimize/__init__.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index 2cfcfbde7..1df92b874 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -366,7 +366,7 @@ class Exchange(object): tickers = await asyncio.gather(*input_coroutines, return_exceptions=True) # Combine tickers - data = [] + data: List = [] for tick in tickers: if tick[0] == pair: data.extend(tick[1]) diff --git a/freqtrade/optimize/__init__.py b/freqtrade/optimize/__init__.py index 49b286fe8..4332f84a4 100644 --- a/freqtrade/optimize/__init__.py +++ b/freqtrade/optimize/__init__.py @@ -218,8 +218,11 @@ def download_backtesting_testdata(datadir: str, logger.debug("Current Start: %s", misc.format_ms_time(data[1][0]) if data else 'None') logger.debug("Current End: %s", misc.format_ms_time(data[-1][0]) if data else 'None') + # Default since_ms to 30 days if nothing is given new_data = exchange.get_history(pair=pair, tick_interval=tick_interval, - since_ms=since_ms) + since_ms=since_ms if since_ms + else + int(arrow.utcnow().shift(days=-30).float_timestamp) * 1000) data.extend(new_data) logger.debug("New Start: %s", misc.format_ms_time(data[0][0]))