From 7fb570cc58fb8157afde1df0e26cd72eabafcd6a Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 25 Aug 2021 20:28:55 +0200 Subject: [PATCH] hyperopt Fallback methods should not be used. --- freqtrade/optimize/hyperopt.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/freqtrade/optimize/hyperopt.py b/freqtrade/optimize/hyperopt.py index 901900121..e0b35df32 100644 --- a/freqtrade/optimize/hyperopt.py +++ b/freqtrade/optimize/hyperopt.py @@ -107,13 +107,25 @@ class Hyperopt: # Populate "fallback" functions here # (hasattr is slow so should not be run during "regular" operations) if hasattr(self.custom_hyperopt, 'populate_indicators'): - self.backtesting.strategy.advise_indicators = ( # type: ignore + logger.warning( + "DEPRECATED: Using `populate_indicators()` in the hyperopt file is deprecated. " + "Please move these methods to your strategy." + ) + self.backtesting.strategy.populate_indicators = ( # type: ignore self.custom_hyperopt.populate_indicators) # type: ignore if hasattr(self.custom_hyperopt, 'populate_buy_trend'): - self.backtesting.strategy.advise_buy = ( # type: ignore + logger.warning( + "DEPRECATED: Using `populate_buy_trend()` in the hyperopt file is deprecated. " + "Please move these methods to your strategy." + ) + self.backtesting.strategy.populate_buy_trend = ( # type: ignore self.custom_hyperopt.populate_buy_trend) # type: ignore if hasattr(self.custom_hyperopt, 'populate_sell_trend'): - self.backtesting.strategy.advise_sell = ( # type: ignore + logger.warning( + "DEPRECATED: Using `populate_sell_trend()` in the hyperopt file is deprecated. " + "Please move these methods to your strategy." + ) + self.backtesting.strategy.populate_sell_trend = ( # type: ignore self.custom_hyperopt.populate_sell_trend) # type: ignore # Use max_open_trades for hyperopt as well, except --disable-max-market-positions is set