mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
parent
6e814af36d
commit
b9f142c31e
|
@ -1255,9 +1255,10 @@ def test_create_dry_run_order_fees(
|
|||
("buy", 29.563, True, True),
|
||||
("sell", 21.563, True, True),
|
||||
])
|
||||
@pytest.mark.parametrize("leverage", [1, 2, 5])
|
||||
@pytest.mark.parametrize("exchange_name", EXCHANGES)
|
||||
def test_create_dry_run_order_limit_fill(default_conf, mocker, side, price, filled, caplog,
|
||||
exchange_name, order_book_l2_usd, converted):
|
||||
exchange_name, order_book_l2_usd, converted, leverage):
|
||||
default_conf['dry_run'] = True
|
||||
exchange = get_patched_exchange(mocker, default_conf, id=exchange_name)
|
||||
mocker.patch.multiple(EXMS,
|
||||
|
@ -1271,7 +1272,7 @@ def test_create_dry_run_order_limit_fill(default_conf, mocker, side, price, fill
|
|||
side=side,
|
||||
amount=1,
|
||||
rate=price,
|
||||
leverage=1.0
|
||||
leverage=leverage,
|
||||
)
|
||||
assert order_book_l2_usd.call_count == 1
|
||||
assert 'id' in order
|
||||
|
@ -1318,9 +1319,10 @@ def test_create_dry_run_order_limit_fill(default_conf, mocker, side, price, fill
|
|||
("sell", 25.564, 1000, 25.5555), # More than orderbook return
|
||||
("sell", 27, 10000, 25.65), # max-slippage 5%
|
||||
])
|
||||
@pytest.mark.parametrize("leverage", [1, 2, 5])
|
||||
@pytest.mark.parametrize("exchange_name", EXCHANGES)
|
||||
def test_create_dry_run_order_market_fill(default_conf, mocker, side, rate, amount, endprice,
|
||||
exchange_name, order_book_l2_usd):
|
||||
exchange_name, order_book_l2_usd, leverage):
|
||||
default_conf['dry_run'] = True
|
||||
exchange = get_patched_exchange(mocker, default_conf, id=exchange_name)
|
||||
mocker.patch.multiple(EXMS,
|
||||
|
@ -1334,7 +1336,7 @@ def test_create_dry_run_order_market_fill(default_conf, mocker, side, rate, amou
|
|||
side=side,
|
||||
amount=amount,
|
||||
rate=rate,
|
||||
leverage=1.0
|
||||
leverage=leverage,
|
||||
)
|
||||
assert 'id' in order
|
||||
assert f'dry_run_{side}_' in order["id"]
|
||||
|
|
Loading…
Reference in New Issue
Block a user