From b69a9134f59f3eed093dc0fad8c5b7191cdcb888 Mon Sep 17 00:00:00 2001 From: saeedrss Date: Fri, 23 Apr 2021 21:27:13 +0430 Subject: [PATCH] fixing support for HitBTC #4778 hitbtc by default send candle from beginning (not most recently) this change fixed --- freqtrade/exchange/exchange.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index ed7918b36..809cdb4e1 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -874,8 +874,15 @@ class Exchange: "Fetching pair %s, interval %s, since %s %s...", pair, timeframe, since_ms, s ) - - data = await self._api_async.fetch_ohlcv(pair, timeframe=timeframe, + #fixing support for HitBTC #4778 + if self.name== 'HitBTC': + data = await self._api_async.fetch_ohlcv(pair, timeframe=timeframe, + since=since_ms, + limit=self.ohlcv_candle_limit(timeframe), + params={"sort": "DESC"} + ) + else: + data = await self._api_async.fetch_ohlcv(pair, timeframe=timeframe, since=since_ms, limit=self.ohlcv_candle_limit(timeframe))