Changed stoploss side on some tests
This commit is contained in:
parent
0a624e70ee
commit
e5b2b64a3f
@ -50,7 +50,6 @@ class Ftx(Exchange):
|
||||
|
||||
Limit orders are defined by having orderPrice set, otherwise a market order is used.
|
||||
"""
|
||||
|
||||
limit_price_pct = order_types.get('stoploss_on_exchange_limit_ratio', 0.99)
|
||||
limit_rate = stop_price * limit_price_pct
|
||||
|
||||
|
@ -1384,7 +1384,7 @@ def test_handle_stoploss_on_exchange_trailing_error(mocker, default_conf, fee, c
|
||||
side_effect=InvalidOrderException())
|
||||
mocker.patch('freqtrade.exchange.Binance.fetch_stoploss_order',
|
||||
return_value=stoploss_order_hanging)
|
||||
freqtrade.handle_trailing_stoploss_on_exchange(trade, stoploss_order_hanging, side="buy")
|
||||
freqtrade.handle_trailing_stoploss_on_exchange(trade, stoploss_order_hanging, side="sell")
|
||||
assert log_has_re(r"Could not cancel stoploss order abcd for pair ETH/BTC.*", caplog)
|
||||
|
||||
# Still try to create order
|
||||
@ -1394,7 +1394,7 @@ def test_handle_stoploss_on_exchange_trailing_error(mocker, default_conf, fee, c
|
||||
caplog.clear()
|
||||
cancel_mock = mocker.patch("freqtrade.exchange.Binance.cancel_stoploss_order", MagicMock())
|
||||
mocker.patch("freqtrade.exchange.Binance.stoploss", side_effect=ExchangeError())
|
||||
freqtrade.handle_trailing_stoploss_on_exchange(trade, stoploss_order_hanging, side="buy")
|
||||
freqtrade.handle_trailing_stoploss_on_exchange(trade, stoploss_order_hanging, side="sell")
|
||||
assert cancel_mock.call_count == 1
|
||||
assert log_has_re(r"Could not create trailing stoploss order for pair ETH/BTC\..*", caplog)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user