Move experimental settings to ask_strategy
This commit is contained in:
@@ -285,7 +285,7 @@ def test_backtest_results(default_conf, fee, mocker, caplog, data) -> None:
|
||||
if data.trailing_stop_positive:
|
||||
default_conf["trailing_stop_positive"] = data.trailing_stop_positive
|
||||
default_conf["trailing_stop_positive_offset"] = data.trailing_stop_positive_offset
|
||||
default_conf["experimental"] = {"use_sell_signal": data.use_sell_signal}
|
||||
default_conf["ask_strategy"] = {"use_sell_signal": data.use_sell_signal}
|
||||
|
||||
mocker.patch("freqtrade.exchange.Exchange.get_fee", MagicMock(return_value=0.0))
|
||||
patch_exchange(mocker)
|
||||
|
@@ -507,6 +507,7 @@ def test_backtesting_start_no_data(default_conf, mocker, caplog, testdatadir) ->
|
||||
|
||||
|
||||
def test_backtest(default_conf, fee, mocker, testdatadir) -> None:
|
||||
default_conf['ask_strategy']['use_sell_signal'] = False
|
||||
mocker.patch('freqtrade.exchange.Exchange.get_fee', fee)
|
||||
patch_exchange(mocker)
|
||||
backtesting = Backtesting(default_conf)
|
||||
@@ -561,6 +562,7 @@ def test_backtest(default_conf, fee, mocker, testdatadir) -> None:
|
||||
|
||||
|
||||
def test_backtest_1min_ticker_interval(default_conf, fee, mocker, testdatadir) -> None:
|
||||
default_conf['ask_strategy']['use_sell_signal'] = False
|
||||
mocker.patch('freqtrade.exchange.Exchange.get_fee', fee)
|
||||
patch_exchange(mocker)
|
||||
backtesting = Backtesting(default_conf)
|
||||
@@ -603,8 +605,9 @@ def test_backtest_pricecontours(default_conf, fee, mocker, testdatadir) -> None:
|
||||
# TODO: Evaluate usefullness of this, the patterns and buy-signls are unrealistic
|
||||
mocker.patch('freqtrade.exchange.Exchange.get_fee', fee)
|
||||
tests = [['raise', 19], ['lower', 0], ['sine', 35]]
|
||||
# We need to enable sell-signal - otherwise it sells on ROI!!
|
||||
default_conf['experimental'] = {"use_sell_signal": True}
|
||||
# use_sell_signal is True by default now, it will sell on the sell signal instead of ROI,
|
||||
# which is what we need here
|
||||
# default_conf['ask_strategy'] = {"use_sell_signal": True}
|
||||
|
||||
for [contour, numres] in tests:
|
||||
simple_backtest(default_conf, contour, numres, mocker, testdatadir)
|
||||
@@ -645,8 +648,9 @@ def test_backtest_alternate_buy_sell(default_conf, fee, mocker, testdatadir):
|
||||
mocker.patch('freqtrade.optimize.backtesting.file_dump_json', MagicMock())
|
||||
backtest_conf = _make_backtest_conf(mocker, conf=default_conf,
|
||||
pair='UNITTEST/BTC', datadir=testdatadir)
|
||||
# We need to enable sell-signal - otherwise it sells on ROI!!
|
||||
default_conf['experimental'] = {"use_sell_signal": True}
|
||||
# use_sell_signal is True by default now, it will sell on the sell signal instead of ROI,
|
||||
# which is what we need here
|
||||
# default_conf['ask_strategy'] = {"use_sell_signal": True}
|
||||
default_conf['ticker_interval'] = '1m'
|
||||
backtesting = Backtesting(default_conf)
|
||||
backtesting.strategy.advise_buy = _trend_alternate # Override
|
||||
@@ -687,8 +691,9 @@ def test_backtest_multi_pair(default_conf, fee, mocker, tres, pair, testdatadir)
|
||||
|
||||
# Remove data for one pair from the beginning of the data
|
||||
data[pair] = data[pair][tres:].reset_index()
|
||||
# We need to enable sell-signal - otherwise it sells on ROI!!
|
||||
default_conf['experimental'] = {"use_sell_signal": True}
|
||||
# use_sell_signal is True by default now, it will sell on the sell signal instead of ROI,
|
||||
# which is what we need here
|
||||
# default_conf['ask_strategy'] = {"use_sell_signal": True}
|
||||
default_conf['ticker_interval'] = '5m'
|
||||
|
||||
backtesting = Backtesting(default_conf)
|
||||
|
Reference in New Issue
Block a user