Merge branch 'develop' into spreadfilter

This commit is contained in:
hroff-1902
2020-02-04 16:54:46 +03:00
committed by GitHub
49 changed files with 523 additions and 257 deletions

View File

@@ -7,7 +7,7 @@ Provides lists as configured in config.json
import logging
from abc import ABC, abstractmethod, abstractproperty
from copy import deepcopy
from typing import Dict, List
from typing import Any, Dict, List
from freqtrade.exchange import market_is_active
@@ -16,7 +16,8 @@ logger = logging.getLogger(__name__)
class IPairList(ABC):
def __init__(self, exchange, pairlistmanager, config, pairlistconfig: dict,
def __init__(self, exchange, pairlistmanager,
config: Dict[str, Any], pairlistconfig: Dict[str, Any],
pairlist_pos: int) -> None:
"""
:param exchange: Exchange instance

View File

@@ -48,10 +48,10 @@ class PrecisionFilter(IPairList):
"""
Filters and sorts pairlists and assigns and returns them again.
"""
stoploss = None
if self._config.get('stoploss') is not None:
stoploss = self._config.get('stoploss')
if stoploss is not None:
# Precalculate sanitized stoploss value to avoid recalculation for every pair
stoploss = 1 - abs(self._config.get('stoploss'))
stoploss = 1 - abs(stoploss)
# Copy list since we're modifying this list
for p in deepcopy(pairlist):
ticker = tickers.get(p)

View File

@@ -1,6 +1,6 @@
import logging
from copy import deepcopy
from typing import Dict, List
from typing import Any, Dict, List
from freqtrade.pairlist.IPairList import IPairList
@@ -9,7 +9,8 @@ logger = logging.getLogger(__name__)
class PriceFilter(IPairList):
def __init__(self, exchange, pairlistmanager, config, pairlistconfig: dict,
def __init__(self, exchange, pairlistmanager,
config: Dict[str, Any], pairlistconfig: Dict[str, Any],
pairlist_pos: int) -> None:
super().__init__(exchange, pairlistmanager, config, pairlistconfig, pairlist_pos)

View File

@@ -6,7 +6,7 @@ Provides lists as configured in config.json
"""
import logging
from datetime import datetime
from typing import Dict, List
from typing import Any, Dict, List
from freqtrade.exceptions import OperationalException
from freqtrade.pairlist.IPairList import IPairList
@@ -18,7 +18,7 @@ SORT_VALUES = ['askVolume', 'bidVolume', 'quoteVolume']
class VolumePairList(IPairList):
def __init__(self, exchange, pairlistmanager, config, pairlistconfig: dict,
def __init__(self, exchange, pairlistmanager, config: Dict[str, Any], pairlistconfig: dict,
pairlist_pos: int) -> None:
super().__init__(exchange, pairlistmanager, config, pairlistconfig, pairlist_pos)
@@ -79,8 +79,8 @@ class VolumePairList(IPairList):
else:
return pairlist
def _gen_pair_whitelist(self, pairlist, tickers, base_currency: str,
key: str, min_val: int) -> List[str]:
def _gen_pair_whitelist(self, pairlist: List[str], tickers: Dict,
base_currency: str, key: str) -> List[str]:
"""
Updates the whitelist with with a dynamically generated list
:param base_currency: base currency as str