mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 18:23:55 +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
|
:return: new allowlist
|
||||||
"""
|
"""
|
||||||
# Get the number of open trades and max open trades config
|
# Get the number of open trades and max open trades config
|
||||||
num_open = Trade.get_open_trade_count()
|
try:
|
||||||
max_trades = self._config['max_open_trades']
|
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):
|
if (num_open >= max_trades) and (max_trades > 0):
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Reference in New Issue
Block a user