Update stoploss method to new functionality

This commit is contained in:
Matthias
2022-03-04 07:07:34 +01:00
parent 011cd58377
commit 62dcebee46
5 changed files with 29 additions and 17 deletions

View File

@@ -110,8 +110,8 @@ def test_stoploss_adjust_huobi(mocker, default_conf):
'price': 1500,
'stopPrice': '1500',
}
assert exchange.stoploss_adjust(1501, order)
assert not exchange.stoploss_adjust(1499, order)
assert exchange.stoploss_adjust(1501, order, 'sell')
assert not exchange.stoploss_adjust(1499, order, 'sell')
# Test with invalid order case
order['type'] = 'stop_loss'
assert not exchange.stoploss_adjust(1501, order)
assert not exchange.stoploss_adjust(1501, order, 'sell')

View File

@@ -120,8 +120,8 @@ def test_stoploss_adjust_kucoin(mocker, default_conf):
'stopPrice': 1500,
'info': {'stopPrice': 1500, 'stop': "limit"},
}
assert exchange.stoploss_adjust(1501, order)
assert not exchange.stoploss_adjust(1499, order)
assert exchange.stoploss_adjust(1501, order, 'sell')
assert not exchange.stoploss_adjust(1499, order, 'sell')
# Test with invalid order case
order['info']['stop'] = None
assert not exchange.stoploss_adjust(1501, order)
assert not exchange.stoploss_adjust(1501, order, 'sell')