From 3167938d43fd7f5bf989b06b087db784877ef3b0 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 20 Aug 2023 11:44:40 +0200 Subject: [PATCH] move "since" fallback to be the last check --- freqtrade/data/history/history_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/data/history/history_utils.py b/freqtrade/data/history/history_utils.py index 5bb89069b..5175195c5 100644 --- a/freqtrade/data/history/history_utils.py +++ b/freqtrade/data/history/history_utils.py @@ -357,9 +357,6 @@ def _download_trades_history(exchange: Exchange, f"available data. Redownloading trades for {pair}...") trades = trades_list_to_df([]) - if not since: - since = dt_ts(dt_now() - timedelta(days=new_pairs_days)) - from_id = trades.iloc[-1]['id'] if not trades.empty else None if not trades.empty and since < trades.iloc[-1]['timestamp']: # Reset since to the last available point @@ -368,6 +365,9 @@ def _download_trades_history(exchange: Exchange, logger.info(f"Using last trade date -5s - Downloading trades for {pair} " f"since: {format_ms_time(since)}.") + if not since: + since = dt_ts(dt_now() - timedelta(days=new_pairs_days)) + logger.debug("Current Start: %s", 'None' if trades.empty else f"{trades.iloc[0]['date']:{DATETIME_PRINT_FORMAT}}") logger.debug("Current End: %s", 'None' if trades.empty else