some short freqtradebot parametrized tests
This commit is contained in:
parent
d604757056
commit
4c91126c49
@ -812,8 +812,10 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
exit_signal_type = "exit_short" if trade.is_short else "exit_long"
|
exit_signal_type = "exit_short" if trade.is_short else "exit_long"
|
||||||
|
|
||||||
# TODO-lev: change to use_exit_signal, ignore_roi_if_enter_signal
|
# TODO-lev: change to use_exit_signal, ignore_roi_if_enter_signal
|
||||||
if (self.config.get('use_sell_signal', True) or
|
if (
|
||||||
self.config.get('ignore_roi_if_buy_signal', False)):
|
self.config.get('use_sell_signal', True) or
|
||||||
|
self.config.get('ignore_roi_if_buy_signal', False)
|
||||||
|
):
|
||||||
analyzed_df, _ = self.dataprovider.get_analyzed_dataframe(trade.pair,
|
analyzed_df, _ = self.dataprovider.get_analyzed_dataframe(trade.pair,
|
||||||
self.strategy.timeframe)
|
self.strategy.timeframe)
|
||||||
|
|
||||||
|
@ -4322,7 +4322,6 @@ def test_apply_fee_conditional(default_conf, fee, caplog, mocker,
|
|||||||
assert walletmock.call_count == 1
|
assert walletmock.call_count == 1
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("is_short", [False, True])
|
|
||||||
def test_order_book_depth_of_market(default_conf, ticker, limit_buy_order_open, limit_buy_order,
|
def test_order_book_depth_of_market(default_conf, ticker, limit_buy_order_open, limit_buy_order,
|
||||||
is_short, fee, mocker, order_book_l2):
|
is_short, fee, mocker, order_book_l2):
|
||||||
default_conf['bid_strategy']['check_depth_of_market']['enabled'] = True
|
default_conf['bid_strategy']['check_depth_of_market']['enabled'] = True
|
||||||
@ -4359,8 +4358,7 @@ def test_order_book_depth_of_market(default_conf, ticker, limit_buy_order_open,
|
|||||||
assert whitelist == default_conf['exchange']['pair_whitelist']
|
assert whitelist == default_conf['exchange']['pair_whitelist']
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("is_short", [False, True])
|
def test_order_book_depth_of_market_high_delta(default_conf, ticker, limit_buy_order,
|
||||||
def test_order_book_depth_of_market_high_delta(default_conf, ticker, limit_buy_order, is_short,
|
|
||||||
fee, mocker, order_book_l2):
|
fee, mocker, order_book_l2):
|
||||||
default_conf['bid_strategy']['check_depth_of_market']['enabled'] = True
|
default_conf['bid_strategy']['check_depth_of_market']['enabled'] = True
|
||||||
# delta is 100 which is impossible to reach. hence check_depth_of_market will return false
|
# delta is 100 which is impossible to reach. hence check_depth_of_market will return false
|
||||||
@ -4449,8 +4447,7 @@ def test_check_depth_of_market(default_conf, mocker, order_book_l2) -> None:
|
|||||||
assert freqtrade._check_depth_of_market('ETH/BTC', conf, side=SignalDirection.LONG) is False
|
assert freqtrade._check_depth_of_market('ETH/BTC', conf, side=SignalDirection.LONG) is False
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("is_short", [False, True])
|
def test_order_book_ask_strategy(default_conf, limit_buy_order_open, limit_buy_order, fee,
|
||||||
def test_order_book_ask_strategy(default_conf, limit_buy_order_open, limit_buy_order, fee, is_short,
|
|
||||||
limit_sell_order_open, mocker, order_book_l2, caplog) -> None:
|
limit_sell_order_open, mocker, order_book_l2, caplog) -> None:
|
||||||
"""
|
"""
|
||||||
test order book ask strategy
|
test order book ask strategy
|
||||||
@ -4527,9 +4524,7 @@ def test_startup_trade_reinit(default_conf, edge_conf, mocker):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("init_persistence")
|
@pytest.mark.usefixtures("init_persistence")
|
||||||
@pytest.mark.parametrize("is_short", [False, True])
|
def test_sync_wallet_dry_run(mocker, default_conf, ticker, fee, limit_buy_order_open, caplog):
|
||||||
def test_sync_wallet_dry_run(
|
|
||||||
mocker, default_conf, ticker, fee, limit_buy_order_open, caplog, is_short):
|
|
||||||
default_conf['dry_run'] = True
|
default_conf['dry_run'] = True
|
||||||
# Initialize to 2 times stake amount
|
# Initialize to 2 times stake amount
|
||||||
default_conf['dry_run_wallet'] = 0.002
|
default_conf['dry_run_wallet'] = 0.002
|
||||||
|
Loading…
Reference in New Issue
Block a user