Allow using pairlists through dataprovider in backtesting

This commit is contained in:
Matthias 2020-08-30 10:07:28 +02:00
parent 2ae04af694
commit 284d39930f
2 changed files with 7 additions and 0 deletions

View File

@ -39,6 +39,12 @@ class DataProvider:
"""
self.__cached_pairs[(pair, timeframe)] = (dataframe, Arrow.utcnow().datetime)
def add_pairlisthandler(self, pairlists) -> None:
"""
Allow adding pairlisthandler after initialization
"""
self._pairlists = pairlists
def refresh(self,
pairlist: ListPairsWithTimeframes,
helping_pairs: ListPairsWithTimeframes = None) -> None:

View File

@ -96,6 +96,7 @@ class Backtesting:
"PrecisionFilter not allowed for backtesting multiple strategies."
)
dataprovider.add_pairlisthandler(self.pairlists)
self.pairlists.refresh_pairlist()
if len(self.pairlists.whitelist) == 0: