mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-09-20 17:41:12 +00:00
add Try block to catch the failure on using FullTradesFilter on non-dry/live run
This commit is contained in:
parent
6121c7ed86
commit
3b54e1e746
|
@ -48,8 +48,13 @@ class FullTradesFilter(IPairList):
|
|||
:return: new allowlist
|
||||
"""
|
||||
# Get the number of open trades and max open trades config
|
||||
num_open = Trade.get_open_trade_count()
|
||||
max_trades = self._config['max_open_trades']
|
||||
try:
|
||||
num_open = Trade.get_open_trade_count()
|
||||
max_trades = self._config['max_open_trades']
|
||||
except AttributeError:
|
||||
# Performancefilter does not work in backtesting.
|
||||
self.log_once("FullTradesFilter is not available in this mode.", logger.warning)
|
||||
return pairlist
|
||||
|
||||
if (num_open >= max_trades) and (max_trades > 0):
|
||||
return []
|
||||
|
|
Loading…
Reference in New Issue
Block a user