diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index b61049c4e..46c45b5e2 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -735,7 +735,7 @@ class Exchange: def refresh_latest_ohlcv(self, pair_list: ListPairsWithTimeframes, *, since_ms: Optional[int] = None, cache: bool = True - ) -> Dict[str, DataFrame]: + ) -> Dict[Tuple[str, str], DataFrame]: """ Refresh in-memory OHLCV asynchronously and set `_klines` with the result Loops asynchronously over pair_list and downloads all pairs async (semi-parallel). diff --git a/freqtrade/pairlist/rangestabilityfilter.py b/freqtrade/pairlist/rangestabilityfilter.py index 8efded9ee..6efe1e2ae 100644 --- a/freqtrade/pairlist/rangestabilityfilter.py +++ b/freqtrade/pairlist/rangestabilityfilter.py @@ -1,12 +1,13 @@ """ Rate of change pairlist filter """ -from copy import deepcopy import logging -from typing import Any, Dict, List +from copy import deepcopy +from typing import Any, Dict, List, Optional import arrow from cachetools.ttl import TTLCache +from pandas import DataFrame from freqtrade.exceptions import OperationalException from freqtrade.misc import plural @@ -78,7 +79,7 @@ class RangeStabilityFilter(IPairList): pairlist.remove(p) return pairlist - def _validate_pair_loc(self, pair: str, daily_candles: Dict[str, Any]) -> bool: + def _validate_pair_loc(self, pair: str, daily_candles: Optional[DataFrame]) -> bool: """ Validate trading range :param pair: Pair that's currently validated diff --git a/tests/strategy/test_interface.py b/tests/strategy/test_interface.py index 7d6a564b1..640849ba4 100644 --- a/tests/strategy/test_interface.py +++ b/tests/strategy/test_interface.py @@ -140,7 +140,8 @@ def test_assert_df(default_conf, mocker, ohlcv_history, caplog): with pytest.raises(StrategyError, match=r"Dataframe returned from strategy.*last close price\."): _STRATEGY.assert_df(ohlcv_history, len(ohlcv_history), - ohlcv_history.loc[df_len, 'close'] + 0.01, ohlcv_history.loc[df_len, 'date']) + ohlcv_history.loc[df_len, 'close'] + 0.01, + ohlcv_history.loc[df_len, 'date']) with pytest.raises(StrategyError, match=r"Dataframe returned from strategy.*last date\."): _STRATEGY.assert_df(ohlcv_history, len(ohlcv_history),