From a80c9794829721253e04cefe05163fd0bc4a7eba Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 18 Oct 2023 20:23:19 +0200 Subject: [PATCH] Improve behavior when downloading trades data on time-based pagination closes #9307 --- freqtrade/exchange/exchange.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 3dfd7d3a5..7638dcef1 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -2305,6 +2305,11 @@ class Exchange: try: t = await self._async_fetch_trades(pair, since=since) if t: + # No more trades to download available at the exchange, + # So we repeatedly get the same trade over and over again. + if since == t[-1][0] and len(t) == 1: + logger.debug("Stopping because no more trades are available.") + break since = t[-1][0] trades.extend(t) # Reached the end of the defined-download period