test_taker_or_maker

This commit is contained in:
Sam Germain 2022-05-03 23:18:13 -06:00
parent e8803477df
commit 5d9aee6b7e

View File

@ -4957,3 +4957,24 @@ def test_stoploss_contract_size(mocker, default_conf, contract_size, order_amoun
assert order['cost'] == 100 assert order['cost'] == 100
assert order['filled'] == 100 assert order['filled'] == 100
assert order['remaining'] == 100 assert order['remaining'] == 100
@pytest.mark.parametrize('order_reason,price_side,order_type,taker_or_maker', [
("entry", "same", "limit", "maker"),
("exit", "same", "limit", "maker"),
("entry", "other", "limit", "taker"),
("exit", "other", "limit", "taker"),
("entry", "same", "market", "maker"),
("exit", "same", "market", "maker"),
("entry", "other", "market", "taker"),
("exit", "other", "market", "taker"),
("stoploss", "same", "limit", "taker"),
("stoploss", "same", "market", "taker"),
("stoploss", "other", "limit", "taker"),
("stoploss", "other", "market", "taker"),
])
def test_taker_or_maker(mocker, default_conf, order_reason, price_side, order_type, taker_or_maker):
default_conf[f"{order_reason}_pricing"]["price_side"] = price_side
default_conf["order_types"][order_reason] = order_type
exchange = get_patched_exchange(mocker, default_conf)
assert exchange.taker_or_maker(order_reason) == taker_or_maker