From 3918f4abbd7ed975e113477f09bd231ceb8f2fab Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 13 Aug 2022 09:27:56 +0200 Subject: [PATCH] Simplify strategy interface by removing explicit self.freqai_info assignment --- docs/freqai.md | 2 -- freqtrade/strategy/interface.py | 1 + freqtrade/templates/FreqaiExampleStrategy.py | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/freqai.md b/docs/freqai.md index c495ba24b..eb76ab1a4 100644 --- a/docs/freqai.md +++ b/docs/freqai.md @@ -401,8 +401,6 @@ The FreqAI strategy requires the user to include the following lines of code in def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: - self.freqai_info = self.config["freqai"] - # All indicators must be populated by populate_any_indicators() for live functionality # to work correctly. diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index d10699e3b..760d852c4 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -151,6 +151,7 @@ class IStrategy(ABC, HyperStrategyMixin): from freqtrade.resolvers.freqaimodel_resolver import FreqaiModelResolver self.freqai = FreqaiModelResolver.load_freqaimodel(self.config) + self.freqai_info = self.config["freqai"] def ft_bot_start(self, **kwargs) -> None: """ diff --git a/freqtrade/templates/FreqaiExampleStrategy.py b/freqtrade/templates/FreqaiExampleStrategy.py index 01f947a6a..d8584d5f9 100644 --- a/freqtrade/templates/FreqaiExampleStrategy.py +++ b/freqtrade/templates/FreqaiExampleStrategy.py @@ -180,8 +180,6 @@ class FreqaiExampleStrategy(IStrategy): def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: - self.freqai_info = self.config["freqai"] - # All indicators must be populated by populate_any_indicators() for live functionality # to work correctly.