logs enriched in case of stop loss on exchange, test fixed
This commit is contained in:
parent
c913fef80c
commit
1a5465fb50
@ -378,13 +378,15 @@ class Exchange(object):
|
|||||||
|
|
||||||
except ccxt.InsufficientFunds as e:
|
except ccxt.InsufficientFunds as e:
|
||||||
raise DependencyException(
|
raise DependencyException(
|
||||||
f'Insufficient funds to place stoploss limit order on market {pair}.'
|
f'Insufficient funds to place stoploss limit order on market {pair}. '
|
||||||
f'Tried to put a stoploss amount {amount} at rate {rate} (total {rate*amount}).'
|
f'Tried to put a stoploss amount {amount} with '
|
||||||
|
f'stop {stop_price} and limit {rate} (total {rate*amount}).'
|
||||||
f'Message: {e}')
|
f'Message: {e}')
|
||||||
except ccxt.InvalidOrder as e:
|
except ccxt.InvalidOrder as e:
|
||||||
raise DependencyException(
|
raise DependencyException(
|
||||||
f'Could not place stoploss limit order on market {pair}.'
|
f'Could not place stoploss limit order on market {pair}.'
|
||||||
f'Tried to place stoploss amount {amount} at rate {rate} (total {rate*amount}).'
|
f'Tried to place stoploss amount {amount} with '
|
||||||
|
f'stop {stop_price} and limit {rate} (total {rate*amount}).'
|
||||||
f'Message: {e}')
|
f'Message: {e}')
|
||||||
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
except (ccxt.NetworkError, ccxt.ExchangeError) as e:
|
||||||
raise TemporaryError(
|
raise TemporaryError(
|
||||||
|
@ -957,7 +957,8 @@ def test_handle_stoploss_on_exchange(mocker, default_conf, fee, caplog,
|
|||||||
stoploss_order_hit = MagicMock(return_value={
|
stoploss_order_hit = MagicMock(return_value={
|
||||||
'status': 'closed',
|
'status': 'closed',
|
||||||
'type': 'stop_loss_limit',
|
'type': 'stop_loss_limit',
|
||||||
'price': 2
|
'price': 3,
|
||||||
|
'average': 2
|
||||||
})
|
})
|
||||||
mocker.patch('freqtrade.exchange.Exchange.get_order', stoploss_order_hit)
|
mocker.patch('freqtrade.exchange.Exchange.get_order', stoploss_order_hit)
|
||||||
assert freqtrade.handle_stoploss_on_exchange(trade) is True
|
assert freqtrade.handle_stoploss_on_exchange(trade) is True
|
||||||
|
Loading…
Reference in New Issue
Block a user