Update more to use candleType

This commit is contained in:
Matthias
2021-12-03 14:11:24 +01:00
parent 5493212672
commit 2f17fa2765
18 changed files with 56 additions and 55 deletions

View File

@@ -2,6 +2,7 @@ from typing import Any, Callable, NamedTuple, Optional, Union
from pandas import DataFrame
from freqtrade.enums import CandleType
from freqtrade.exceptions import OperationalException
from freqtrade.strategy.strategy_helper import merge_informative_pair
@@ -14,7 +15,7 @@ class InformativeData(NamedTuple):
timeframe: str
fmt: Union[str, Callable[[Any], str], None]
ffill: bool
candle_type: str = ''
candle_type: CandleType = CandleType.SPOT_
def informative(timeframe: str, asset: str = '',

View File

@@ -13,8 +13,7 @@ from pandas import DataFrame
from freqtrade.constants import ListPairsWithTimeframes
from freqtrade.data.dataprovider import DataProvider
from freqtrade.enums import SellType, SignalDirection, SignalTagType, SignalType
from freqtrade.enums.candletype import CandleType
from freqtrade.enums import CandleType, SellType, SignalDirection, SignalTagType, SignalType
from freqtrade.exceptions import OperationalException, StrategyError
from freqtrade.exchange import timeframe_to_minutes, timeframe_to_seconds
from freqtrade.exchange.exchange import timeframe_to_next_date
@@ -424,7 +423,9 @@ class IStrategy(ABC, HyperStrategyMixin):
"""
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]
informative_pairs = [
(p[0], p[1], CandleType.from_string(p[2]) if len(p) > 2 else CandleType.SPOT_)
for p in informative_pairs]
for inf_data, _ in self._ft_informative:
if inf_data.asset:
pair_tf = (