Disallow VolumePairList from backtesting for now
This commit is contained in:
parent
e8530c36d3
commit
fb8a85da01
@ -65,6 +65,9 @@ class Backtesting:
|
|||||||
self.exchange = ExchangeResolver.load_exchange(self.config['exchange']['name'], self.config)
|
self.exchange = ExchangeResolver.load_exchange(self.config['exchange']['name'], self.config)
|
||||||
|
|
||||||
self.pairlists = PairListManager(self.exchange, self.config)
|
self.pairlists = PairListManager(self.exchange, self.config)
|
||||||
|
if 'VolumePairList' in self.pairlists.name_list:
|
||||||
|
raise OperationalException("VolumePairList not allowed for backtesting.")
|
||||||
|
|
||||||
self.pairlists.refresh_pairlist()
|
self.pairlists.refresh_pairlist()
|
||||||
|
|
||||||
if len(self.pairlists.whitelist) == 0:
|
if len(self.pairlists.whitelist) == 0:
|
||||||
|
@ -378,9 +378,7 @@ def test_backtesting_start_no_data(default_conf, mocker, caplog, testdatadir) ->
|
|||||||
|
|
||||||
|
|
||||||
def test_backtesting_no_pair_left(default_conf, mocker, caplog, testdatadir) -> None:
|
def test_backtesting_no_pair_left(default_conf, mocker, caplog, testdatadir) -> None:
|
||||||
def get_timerange(input1):
|
mocker.patch('freqtrade.exchange.Exchange.exchange_has', MagicMock(return_value=True))
|
||||||
return Arrow(2017, 11, 14, 21, 17), Arrow(2017, 11, 14, 22, 59)
|
|
||||||
|
|
||||||
mocker.patch('freqtrade.data.history.history_utils.load_pair_history',
|
mocker.patch('freqtrade.data.history.history_utils.load_pair_history',
|
||||||
MagicMock(return_value=pd.DataFrame()))
|
MagicMock(return_value=pd.DataFrame()))
|
||||||
mocker.patch('freqtrade.data.history.get_timerange', get_timerange)
|
mocker.patch('freqtrade.data.history.get_timerange', get_timerange)
|
||||||
@ -397,6 +395,10 @@ def test_backtesting_no_pair_left(default_conf, mocker, caplog, testdatadir) ->
|
|||||||
with pytest.raises(OperationalException, match='No pair in whitelist.'):
|
with pytest.raises(OperationalException, match='No pair in whitelist.'):
|
||||||
Backtesting(default_conf)
|
Backtesting(default_conf)
|
||||||
|
|
||||||
|
default_conf['pairlists'] = [{"method": "VolumePairList", "number_assets": 5}]
|
||||||
|
with pytest.raises(OperationalException, match='VolumePairList not allowed for backtesting.'):
|
||||||
|
Backtesting(default_conf)
|
||||||
|
|
||||||
|
|
||||||
def test_backtest(default_conf, fee, mocker, testdatadir) -> None:
|
def test_backtest(default_conf, fee, mocker, testdatadir) -> None:
|
||||||
default_conf['ask_strategy']['use_sell_signal'] = False
|
default_conf['ask_strategy']['use_sell_signal'] = False
|
||||||
|
Loading…
Reference in New Issue
Block a user