fix IStrategy: abstract methods still need to pass through return value

otherwise doing something like:
```py
dataframe = super().populate_indicators(dataframe, ...)
```

won't work, because `dataframe` becomes `None`.

This is needed if one of those methods uses dataframe.copy() instead of
just working on reference. e.g. using `merge_informative` in
`populate_indicator` in a nested class hierarchy
This commit is contained in:
Joe Schr 2021-04-30 14:30:37 +02:00
parent 6763bd447e
commit f3388ed9aa

View File

@ -161,6 +161,7 @@ class IStrategy(ABC, HyperStrategyMixin):
:param metadata: Additional information, like the currently traded pair :param metadata: Additional information, like the currently traded pair
:return: a Dataframe with all mandatory indicators for the strategies :return: a Dataframe with all mandatory indicators for the strategies
""" """
return dataframe
@abstractmethod @abstractmethod
def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
@ -170,6 +171,7 @@ class IStrategy(ABC, HyperStrategyMixin):
:param metadata: Additional information, like the currently traded pair :param metadata: Additional information, like the currently traded pair
:return: DataFrame with buy column :return: DataFrame with buy column
""" """
return dataframe
@abstractmethod @abstractmethod
def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
@ -179,6 +181,7 @@ class IStrategy(ABC, HyperStrategyMixin):
:param metadata: Additional information, like the currently traded pair :param metadata: Additional information, like the currently traded pair
:return: DataFrame with sell column :return: DataFrame with sell column
""" """
return dataframe
def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool: def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:
""" """