mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 02:12:01 +00:00
Don't rely on status when determining open order count
This commit is contained in:
parent
1d23ba6e30
commit
9f445cb053
|
@ -1516,8 +1516,10 @@ class FreqtradeBot(LoggingMixin):
|
|||
filled_amount = safe_value_fallback2(corder, order, 'filled', 'filled')
|
||||
if isclose(filled_amount, 0.0, abs_tol=constants.MATH_CLOSE_PREC):
|
||||
# if trade is not partially completed and it's the only order, just delete the trade
|
||||
open_order_count = len([order for order in trade.orders if order.status == 'open'])
|
||||
if open_order_count <= 1 and trade.nr_of_successful_entries == 0 and not replacing:
|
||||
open_order_count = len([
|
||||
order for order in trade.orders if order.ft_is_open and order.order_id != order_id
|
||||
])
|
||||
if open_order_count < 1 and trade.nr_of_successful_entries == 0 and not replacing:
|
||||
logger.info(f'{side} order fully cancelled. Removing {trade} from database.')
|
||||
trade.delete()
|
||||
was_trade_fully_canceled = True
|
||||
|
|
Loading…
Reference in New Issue
Block a user