Verify if trade is closed before acting on Stoploss_on_exchange

This commit is contained in:
Matthias
2020-01-23 20:36:48 +01:00
parent ea5ac1efb5
commit 70b9bd9c0e
2 changed files with 3 additions and 1 deletions

View File

@@ -689,9 +689,10 @@ class FreqtradeBot:
self._notify_sell(trade, "stoploss")
return True
if trade.open_order_id:
if trade.open_order_id or not trade.is_open:
# Trade has an open Buy or Sell order, Stoploss-handling can't happen in this case
# as the Amount on the exchange is tied up in another trade.
# The trade can be closed already (sell-order fill confirmation came in this iteration)
return False
# If buy order is fulfilled but there is no stoploss, we add a stoploss on exchange