|
|
|
|
@ -5,6 +5,7 @@ import logging
|
|
|
|
|
from typing import Any, Dict, Optional
|
|
|
|
|
|
|
|
|
|
from freqtrade.constants import Config
|
|
|
|
|
from freqtrade.exceptions import OperationalException
|
|
|
|
|
from freqtrade.exchange.types import Ticker
|
|
|
|
|
from freqtrade.plugins.pairlist.IPairList import IPairList
|
|
|
|
|
|
|
|
|
|
@ -22,6 +23,12 @@ class SpreadFilter(IPairList):
|
|
|
|
|
self._max_spread_ratio = pairlistconfig.get('max_spread_ratio', 0.005)
|
|
|
|
|
self._enabled = self._max_spread_ratio != 0
|
|
|
|
|
|
|
|
|
|
if not self._exchange.get_option('tickers_have_bid_ask'):
|
|
|
|
|
raise OperationalException(
|
|
|
|
|
f"{self.name} requires exchange to have bid/ask data for tickers, "
|
|
|
|
|
"which is not available for the selected exchange / trading mode."
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def needstickers(self) -> bool:
|
|
|
|
|
"""
|
|
|
|
|
|