Convert InformativeData to dataclass
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from typing import Any, Callable, NamedTuple, Optional, Union
|
||||
from dataclasses import dataclass
|
||||
from typing import Any, Callable, Optional, Union
|
||||
|
||||
from pandas import DataFrame
|
||||
|
||||
@@ -10,7 +11,8 @@ from freqtrade.strategy.strategy_helper import merge_informative_pair
|
||||
PopulateIndicators = Callable[[Any, DataFrame, dict], DataFrame]
|
||||
|
||||
|
||||
class InformativeData(NamedTuple):
|
||||
@dataclass
|
||||
class InformativeData:
|
||||
asset: Optional[str]
|
||||
timeframe: str
|
||||
fmt: Union[str, Callable[[Any], str], None]
|
||||
|
@@ -158,9 +158,7 @@ class IStrategy(ABC, HyperStrategyMixin):
|
||||
raise OperationalException('Informative timeframe must be equal or higher than '
|
||||
'strategy timeframe!')
|
||||
if not informative_data.candle_type:
|
||||
informative_data = InformativeData(
|
||||
informative_data.asset, informative_data.timeframe, informative_data.fmt,
|
||||
informative_data.ffill, config['candle_type_def'])
|
||||
informative_data.candle_type = config['candle_type_def']
|
||||
self._ft_informative.append((informative_data, cls_method))
|
||||
|
||||
@abstractmethod
|
||||
|
Reference in New Issue
Block a user