Test stoploss_adjust okx

This commit is contained in:
Matthias 2023-03-20 06:46:00 +01:00
parent 4690244673
commit 54d8aa7782

View File

@ -544,3 +544,18 @@ def test_fetch_stoploss_order_okx(default_conf, mocker):
assert api_mock.fetch_closed_orders.call_count == 0 assert api_mock.fetch_closed_orders.call_count == 0
assert api_mock.fetch_canceled_orders.call_count == 0 assert api_mock.fetch_canceled_orders.call_count == 0
assert dro_mock.call_count == 1 assert dro_mock.call_count == 1
@pytest.mark.parametrize('sl1,sl2,sl3,side', [
(1501, 1499, 1501, "sell"),
(1499, 1501, 1499, "buy")
])
def test_stoploss_adjust_okx(mocker, default_conf, sl1, sl2, sl3, side):
exchange = get_patched_exchange(mocker, default_conf, id='okx')
order = {
'type': 'stoploss',
'price': 1500,
'stopLossPrice': 1500,
}
assert exchange.stoploss_adjust(sl1, order, side=side)
assert not exchange.stoploss_adjust(sl2, order, side=side)