From c20157e64f5b34669a2aad2a8e6063090601f4f3 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 28 Nov 2021 15:43:04 +0100 Subject: [PATCH] Add compatibility code for existing informative_pairs implementation --- freqtrade/strategy/interface.py | 2 ++ tests/strategy/strats/informative_decorator_strategy.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 8a4e50343..bcb0a93b4 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -422,6 +422,8 @@ class IStrategy(ABC, HyperStrategyMixin): Internal method which gathers all informative pairs (user or automatically defined). """ informative_pairs = self.informative_pairs() + # Compatibility code for 2 tuple informative pairs + informative_pairs = [(p[0], p[1], p[2] if len(p) > 2 else '') for p in informative_pairs] for inf_data, _ in self._ft_informative: if inf_data.asset: pair_tf = ( diff --git a/tests/strategy/strats/informative_decorator_strategy.py b/tests/strategy/strats/informative_decorator_strategy.py index 448b67956..91c4642fa 100644 --- a/tests/strategy/strats/informative_decorator_strategy.py +++ b/tests/strategy/strats/informative_decorator_strategy.py @@ -19,7 +19,8 @@ class InformativeDecoratorTest(IStrategy): startup_candle_count: int = 20 def informative_pairs(self): - return [('NEO/USDT', '5m', '')] + # Intentionally return 2 tuples, must be converted to 3 in compatibility code + return [('NEO/USDT', '5m')] def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe['buy'] = 0