diff --git a/freqtrade/misc.py b/freqtrade/misc.py index 6a93b6f26..b2aca5fd6 100644 --- a/freqtrade/misc.py +++ b/freqtrade/misc.py @@ -14,7 +14,7 @@ import pandas import rapidjson from freqtrade.constants import DECIMAL_PER_COIN_FALLBACK, DECIMALS_PER_COIN -from freqtrade.enums.signaltype import SignalTagType, SignalType +from freqtrade.enums import SignalTagType, SignalType logger = logging.getLogger(__name__) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 93a582e80..0a9a155ea 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -698,11 +698,7 @@ class IStrategy(ABC, HyperStrategyMixin): lock_time = timeframe_to_next_date(self.timeframe, candle_date) return PairLocks.is_pair_locked(pair, lock_time, side=side) - def analyze_ticker( - self, - dataframe: DataFrame, - metadata: dict - ) -> DataFrame: + def analyze_ticker(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Parses the given candle (OHLCV) data and returns a populated DataFrame add several TA indicators and entry order signal to it @@ -716,11 +712,7 @@ class IStrategy(ABC, HyperStrategyMixin): dataframe = self.advise_exit(dataframe, metadata) return dataframe - def _analyze_ticker_internal( - self, - dataframe: DataFrame, - metadata: dict - ) -> DataFrame: + def _analyze_ticker_internal(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Parses the given candle (OHLCV) data and returns a populated DataFrame add several TA indicators and buy signal to it @@ -753,20 +745,16 @@ class IStrategy(ABC, HyperStrategyMixin): return dataframe - def analyze_pair( - self, - pair: str - ) -> None: + def analyze_pair(self, pair: str) -> None: """ Fetch data for this pair from dataprovider and analyze. Stores the dataframe into the dataprovider. The analyzed dataframe is then accessible via `dp.get_analyzed_dataframe()`. :param pair: Pair to analyze. """ - candle_type = self.config.get('candle_type_def', CandleType.SPOT) - - dataframe = self.dp.ohlcv(pair, self.timeframe, candle_type) - + dataframe = self.dp.ohlcv( + pair, self.timeframe, candle_type=self.config.get('candle_type_def', CandleType.SPOT) + ) if not isinstance(dataframe, DataFrame) or dataframe.empty: logger.warning('Empty candle (OHLCV) data for pair %s', pair) return @@ -787,10 +775,7 @@ class IStrategy(ABC, HyperStrategyMixin): logger.warning('Empty dataframe for pair %s', pair) return - def analyze( - self, - pairs: List[str] - ) -> None: + def analyze(self, pairs: List[str]) -> None: """ Analyze all pairs using analyze_pair(). :param pairs: List of pairs to analyze @@ -798,7 +783,7 @@ class IStrategy(ABC, HyperStrategyMixin): for pair in pairs: self.analyze_pair(pair) - @ staticmethod + @staticmethod def preserve_df(dataframe: DataFrame) -> Tuple[int, float, datetime]: """ keep some data for dataframes """ return len(dataframe), dataframe["close"].iloc[-1], dataframe["date"].iloc[-1] @@ -1219,9 +1204,6 @@ class IStrategy(ABC, HyperStrategyMixin): dataframe = _create_and_merge_informative_pair( self, dataframe, metadata, inf_data, populate_fn) - # If in follower mode, get analyzed dataframe from leader df's in dp - # otherise run populate_indicators - return self.populate_indicators(dataframe, metadata) def advise_entry(self, dataframe: DataFrame, metadata: dict) -> DataFrame: diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index 146303701..5dfa77d8b 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -406,7 +406,6 @@ def test_api_cleanup(default_conf, mocker, caplog): apiserver = ApiServer(default_conf) apiserver.add_rpc_handler(RPC(get_patched_freqtradebot(mocker, default_conf))) - apiserver.start_api() apiserver.cleanup() assert apiserver._server.cleanup.call_count == 1