diff --git a/freqtrade/data/history/history_utils.py b/freqtrade/data/history/history_utils.py index 9deab401e..8a65db26a 100644 --- a/freqtrade/data/history/history_utils.py +++ b/freqtrade/data/history/history_utils.py @@ -17,7 +17,6 @@ from freqtrade.constants import ( from freqtrade.data.converter import ( clean_ohlcv_dataframe, convert_trades_to_ohlcv, - ohlcv_to_dataframe, trades_df_remove_duplicates, trades_list_to_df, ) @@ -273,7 +272,7 @@ def _download_pair_history( ) # Default since_ms to 30 days if nothing is given - new_data = exchange.get_historic_ohlcv( + new_dataframe = exchange.get_historic_ohlcv( pair=pair, timeframe=timeframe, since_ms=( @@ -285,10 +284,6 @@ def _download_pair_history( candle_type=candle_type, until_ms=until_ms if until_ms else None, ) - # TODO: Maybe move parsing to exchange class (?) - new_dataframe = ohlcv_to_dataframe( - new_data, timeframe, pair, fill_missing=False, drop_incomplete=True - ) if data.empty: data = new_dataframe else: diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 47ff89f46..9d84f59e4 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -2223,7 +2223,7 @@ class Exchange: candle_type: CandleType, is_new_pair: bool = False, until_ms: Optional[int] = None, - ) -> List: + ) -> DataFrame: """ Get candle history using asyncio and returns the list of candles. Handles all async work for this. @@ -2233,7 +2233,7 @@ class Exchange: :param since_ms: Timestamp in milliseconds to get history from :param until_ms: Timestamp in milliseconds to get history up to :param candle_type: '', mark, index, premiumIndex, or funding_rate - :return: List with candle (OHLCV) data + :return: Dataframe with candle (OHLCV) data """ pair, _, _, data, _ = self.loop.run_until_complete( self._async_get_historic_ohlcv( @@ -2246,7 +2246,7 @@ class Exchange: ) ) logger.info(f"Downloaded data for {pair} with length {len(data)}.") - return data + return ohlcv_to_dataframe(data, timeframe, pair, fill_missing=False, drop_incomplete=True) async def _async_get_historic_ohlcv( self,