Disallow PerformanceFilter for backtesting

closes #4072
This commit is contained in:
Matthias 2020-12-16 19:24:47 +01:00
parent 8441d0f60f
commit 266031a6be
3 changed files with 13 additions and 0 deletions

View File

@ -65,6 +65,9 @@ The `refresh_period` setting allows to define the period (in seconds), at which
}],
```
!!! Note
`VolumePairList` does not support backtesting mode.
#### AgeFilter
Removes pairs that have been listed on the exchange for less than `min_days_listed` days (defaults to `10`).
@ -84,6 +87,9 @@ Sorts pairs by past trade performance, as follows:
Trade count is used as a tie breaker.
!!! Note
`PerformanceFilter` does not support backtesting mode.
#### PrecisionFilter
Filters low-value coins which would not allow setting stoplosses.

View File

@ -102,6 +102,8 @@ class Backtesting:
self.pairlists = PairListManager(self.exchange, self.config)
if 'VolumePairList' in self.pairlists.name_list:
raise OperationalException("VolumePairList not allowed for backtesting.")
if 'PerformanceFilter' in self.pairlists.name_list:
raise OperationalException("PerformanceFilter not allowed for backtesting.")
if len(self.strategylist) > 1 and 'PrecisionFilter' in self.pairlists.name_list:
raise OperationalException(

View File

@ -430,6 +430,11 @@ def test_backtesting_pairlist_list(default_conf, mocker, caplog, testdatadir, ti
with pytest.raises(OperationalException, match='VolumePairList not allowed for backtesting.'):
Backtesting(default_conf)
default_conf['pairlists'] = [{"method": "StaticPairList"}, {"method": "PerformanceFilter"}]
with pytest.raises(OperationalException,
match='PerformanceFilter not allowed for backtesting.'):
Backtesting(default_conf)
default_conf['pairlists'] = [{"method": "StaticPairList"}, {"method": "PrecisionFilter"}, ]
Backtesting(default_conf)