Move create_pair_list to pairlistmanager

This commit is contained in:
hroff-1902
2020-05-18 13:54:21 +03:00
parent 5f2a871637
commit 627c5059f0
6 changed files with 16 additions and 18 deletions

View File

@@ -5,7 +5,7 @@ Provides lists as configured in config.json
"""
import logging
from typing import Dict, List
from typing import Dict, List, Tuple
from cachetools import TTLCache, cached
@@ -13,9 +13,14 @@ from freqtrade.exceptions import OperationalException
from freqtrade.pairlist.IPairList import IPairList
from freqtrade.resolvers import PairListResolver
logger = logging.getLogger(__name__)
# List of pairs with their timeframes
ListPairsWithTimeframes = List[Tuple[str, str]]
class PairListManager():
def __init__(self, exchange, config: dict) -> None:
@@ -94,3 +99,9 @@ class PairListManager():
pairlist = IPairList.verify_blacklist(pairlist, self.blacklist, True)
self._whitelist = pairlist
def create_pair_list(self, pairs: List[str], timeframe: str = None) -> ListPairsWithTimeframes:
"""
Create list of pair tuples with (pair, ticker_interval)
"""
return [(pair, timeframe or self._config['ticker_interval']) for pair in pairs]