Fix PerformanceFilter failing in test-pairlist mode

This commit is contained in:
Matthias
2021-05-16 19:55:13 +02:00
parent 0d50e99563
commit 37b71b8cfd
2 changed files with 20 additions and 2 deletions

View File

@@ -39,7 +39,12 @@ class PerformanceFilter(IPairList):
:return: new allowlist
"""
# Get the trading performance for pairs from database
performance = pd.DataFrame(Trade.get_overall_performance())
try:
performance = pd.DataFrame(Trade.get_overall_performance())
except AttributeError:
# Performancefilter does not work in backtesting.
self.log_once("PerformanceFilter is not available in this mode.", logger.warning)
return pairlist
# Skip performance-based sorting if no performance data is available
if len(performance) == 0: