From ac50efbe9ebaed526c268708106a901d7ec8810f Mon Sep 17 00:00:00 2001 From: Peter Willemsen Date: Tue, 1 Feb 2022 23:01:54 +0100 Subject: [PATCH] =?UTF-8?q?fixed=20exchanges=20showing=20data=20from=20the?= =?UTF-8?q?=20future=20(not=20the=20kind=20that=20makes=20you=20rich=20?= =?UTF-8?q?=F0=9F=98=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- freqtrade/exchange/exchange.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 004fb2437..9c922619c 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -1290,6 +1290,10 @@ class Exchange: p, _, new_data = res if p == pair: data.extend(new_data) + # Some exchanges show data past the current time and set all values to null. + current_time = arrow.utcnow().int_timestamp * 1000 + data = filter(lambda item: item[0] < current_time, data) + # Sort data again after extending the result - above calls return in "async order" data = sorted(data, key=lambda x: x[0]) return pair, timeframe, data