From 6fb4d83ab3f2cb7b4402223b073ccb0a868fcb76 Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Sun, 2 May 2021 16:35:06 +0300 Subject: [PATCH] Fix dataprovider in hyperopt. --- freqtrade/optimize/backtesting.py | 1 + freqtrade/optimize/hyperopt.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 73ad4e774..6d8b329bb 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -353,6 +353,7 @@ class Backtesting: # Update dataprovider cache for pair, dataframe in processed.items(): self.dataprovider._set_cached_df(pair, self.timeframe, dataframe) + self.strategy.dp = self.dataprovider # Use dict of lists with data for performance # (looping lists is a lot faster than pandas DataFrames) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index e0a6d50a0..5e3d01047 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -372,8 +372,6 @@ class Hyperopt: self.backtesting.exchange._api_async = None # type: ignore # self.backtesting.exchange = None # type: ignore self.backtesting.pairlists = None # type: ignore - self.backtesting.strategy.dp = None # type: ignore - IStrategy.dp = None # type: ignore cpus = cpu_count() logger.info(f"Found {cpus} CPU cores. Let's make them scream!")