mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Test stoploss_adjust okx
This commit is contained in:
parent
4690244673
commit
54d8aa7782
|
@ -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_canceled_orders.call_count == 0
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user