Merge branch 'feat/short' into fs_fix
This commit is contained in:
commit
14bce0b1c3
@ -206,7 +206,7 @@ Hyper-optimization will, for each epoch round, pick one trigger and possibly mul
|
|||||||
|
|
||||||
#### Sell optimization
|
#### Sell optimization
|
||||||
|
|
||||||
Similar to the buy-signal above, sell-signals can also be optimized.
|
Similar to the entry-signal above, exit-signals can also be optimized.
|
||||||
Place the corresponding settings into the following methods
|
Place the corresponding settings into the following methods
|
||||||
|
|
||||||
* Define the parameters at the class level hyperopt shall be optimizing, either naming them `sell_*`, or by explicitly defining `space='sell'`.
|
* Define the parameters at the class level hyperopt shall be optimizing, either naming them `sell_*`, or by explicitly defining `space='sell'`.
|
||||||
|
@ -906,7 +906,7 @@ def test_backtest_pricecontours_protections(default_conf, fee, mocker, testdatad
|
|||||||
['sine', 9],
|
['sine', 9],
|
||||||
['raise', 10],
|
['raise', 10],
|
||||||
]
|
]
|
||||||
# While buy-signals are unrealistic, running backtesting
|
# While entry-signals are unrealistic, running backtesting
|
||||||
# over and over again should not cause different results
|
# over and over again should not cause different results
|
||||||
for [contour, numres] in tests:
|
for [contour, numres] in tests:
|
||||||
# Debug output for random test failure
|
# Debug output for random test failure
|
||||||
@ -935,7 +935,7 @@ def test_backtest_pricecontours(default_conf, fee, mocker, testdatadir,
|
|||||||
mocker.patch("freqtrade.exchange.Exchange.get_min_pair_stake_amount", return_value=0.00001)
|
mocker.patch("freqtrade.exchange.Exchange.get_min_pair_stake_amount", return_value=0.00001)
|
||||||
mocker.patch("freqtrade.exchange.Exchange.get_max_pair_stake_amount", return_value=float('inf'))
|
mocker.patch("freqtrade.exchange.Exchange.get_max_pair_stake_amount", return_value=float('inf'))
|
||||||
mocker.patch('freqtrade.exchange.Exchange.get_fee', fee)
|
mocker.patch('freqtrade.exchange.Exchange.get_fee', fee)
|
||||||
# While buy-signals are unrealistic, running backtesting
|
# While entry-signals are unrealistic, running backtesting
|
||||||
# over and over again should not cause different results
|
# over and over again should not cause different results
|
||||||
assert len(simple_backtest(default_conf, contour, mocker, testdatadir)['results']) == expected
|
assert len(simple_backtest(default_conf, contour, mocker, testdatadir)['results']) == expected
|
||||||
|
|
||||||
|
@ -3784,7 +3784,7 @@ def test_ignore_roi_if_buy_signal(default_conf_usdt, limit_order, limit_order_op
|
|||||||
|
|
||||||
assert freqtrade.handle_trade(trade) is False
|
assert freqtrade.handle_trade(trade) is False
|
||||||
|
|
||||||
# Test if buy-signal is absent (should sell due to roi = true)
|
# Test if entry-signal is absent (should sell due to roi = true)
|
||||||
if is_short:
|
if is_short:
|
||||||
patch_get_signal(freqtrade, enter_long=False, exit_short=False)
|
patch_get_signal(freqtrade, enter_long=False, exit_short=False)
|
||||||
else:
|
else:
|
||||||
@ -4001,7 +4001,7 @@ def test_disable_ignore_roi_if_buy_signal(default_conf_usdt, limit_order, limit_
|
|||||||
patch_get_signal(freqtrade, enter_long=not is_short, enter_short=is_short, exit_short=is_short)
|
patch_get_signal(freqtrade, enter_long=not is_short, enter_short=is_short, exit_short=is_short)
|
||||||
assert freqtrade.handle_trade(trade) is True
|
assert freqtrade.handle_trade(trade) is True
|
||||||
|
|
||||||
# Test if buy-signal is absent
|
# Test if entry-signal is absent
|
||||||
patch_get_signal(freqtrade)
|
patch_get_signal(freqtrade)
|
||||||
assert freqtrade.handle_trade(trade) is True
|
assert freqtrade.handle_trade(trade) is True
|
||||||
assert trade.sell_reason == SellType.ROI.value
|
assert trade.sell_reason == SellType.ROI.value
|
||||||
|
@ -259,12 +259,12 @@ def test_generate_candlestick_graph_no_trades(default_conf, mocker, testdatadir)
|
|||||||
|
|
||||||
buy = find_trace_in_fig_data(figure.data, "buy")
|
buy = find_trace_in_fig_data(figure.data, "buy")
|
||||||
assert isinstance(buy, go.Scatter)
|
assert isinstance(buy, go.Scatter)
|
||||||
# All buy-signals should be plotted
|
# All entry-signals should be plotted
|
||||||
assert int(data['enter_long'].sum()) == len(buy.x)
|
assert int(data['enter_long'].sum()) == len(buy.x)
|
||||||
|
|
||||||
sell = find_trace_in_fig_data(figure.data, "sell")
|
sell = find_trace_in_fig_data(figure.data, "sell")
|
||||||
assert isinstance(sell, go.Scatter)
|
assert isinstance(sell, go.Scatter)
|
||||||
# All buy-signals should be plotted
|
# All entry-signals should be plotted
|
||||||
assert int(data['exit_long'].sum()) == len(sell.x)
|
assert int(data['exit_long'].sum()) == len(sell.x)
|
||||||
|
|
||||||
assert find_trace_in_fig_data(figure.data, "Bollinger Band")
|
assert find_trace_in_fig_data(figure.data, "Bollinger Band")
|
||||||
|
Loading…
Reference in New Issue
Block a user