Raise exception if StaticPairList on a non-first position

This commit is contained in:
hroff-1902
2020-05-25 23:14:51 +03:00
parent c3206d72cb
commit a484124272
2 changed files with 20 additions and 6 deletions

View File

@@ -6,6 +6,7 @@ Provides pair white list as it configured in config
import logging
from typing import Dict, List
from freqtrade.exceptions import OperationalException
from freqtrade.pairlist.IPairList import IPairList
@@ -47,4 +48,8 @@ class StaticPairList(IPairList):
:param tickers: Tickers (from exchange.get_tickers()). May be cached.
:return: new whitelist
"""
return pairlist
if self._pairlist_pos != 0:
raise OperationalException(f"{self.name} can only be used in the first position "
"in the list of Pairlist Handlers.")
else:
return pairlist