Added candle_type to a lot of methods, wrote some tests
This commit is contained in:
@@ -14,6 +14,7 @@ class InformativeData(NamedTuple):
|
||||
timeframe: str
|
||||
fmt: Union[str, Callable[[Any], str], None]
|
||||
ffill: bool
|
||||
candle_type: str = ''
|
||||
|
||||
|
||||
def informative(timeframe: str, asset: str = '',
|
||||
|
@@ -424,14 +424,18 @@ class IStrategy(ABC, HyperStrategyMixin):
|
||||
informative_pairs = self.informative_pairs()
|
||||
for inf_data, _ in self._ft_informative:
|
||||
if inf_data.asset:
|
||||
pair_tf = (_format_pair_name(self.config, inf_data.asset), inf_data.timeframe)
|
||||
pair_tf = (
|
||||
_format_pair_name(self.config, inf_data.asset),
|
||||
inf_data.timeframe,
|
||||
inf_data.candle_type
|
||||
)
|
||||
informative_pairs.append(pair_tf)
|
||||
else:
|
||||
if not self.dp:
|
||||
raise OperationalException('@informative decorator with unspecified asset '
|
||||
'requires DataProvider instance.')
|
||||
for pair in self.dp.current_whitelist():
|
||||
informative_pairs.append((pair, inf_data.timeframe))
|
||||
informative_pairs.append((pair, inf_data.timeframe, inf_data.candle_type))
|
||||
return list(set(informative_pairs))
|
||||
|
||||
def get_strategy_name(self) -> str:
|
||||
|
Reference in New Issue
Block a user