diff --git a/freqtrade/constants.py b/freqtrade/constants.py index eea3b6cef..077be51f7 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -56,7 +56,7 @@ WEBHOOK_FORMAT_OPTIONS = ['form', 'json', 'raw'] ENV_VAR_PREFIX = 'FREQTRADE__' -NON_OPEN_EXCHANGE_STATES = ('cancelled', 'canceled', 'expired') +NON_OPEN_EXCHANGE_STATES = ('cancelled', 'canceled', 'closed', 'expired') # Define decimals per coin for outputs # Only used for outputs. diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 26109993d..4472c44b6 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1232,7 +1232,7 @@ class FreqtradeBot(LoggingMixin): trade.open_order_id = order['id'] trade.sell_order_status = '' trade.close_rate_requested = limit - trade.sell_reason = exit_tag or sell_reason.sell_reason + trade.sell_reason = exit_tag or sell_reason.sell_reason + order['id'] + ' debug' # Lock pair for one candle to prevent immediate re-buys self.strategy.lock_pair(trade.pair, datetime.now(timezone.utc), diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index 545b3d7d1..a54f286fc 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -688,7 +688,7 @@ class LocalTrade(): if (o.ft_is_open or (o.ft_order_side != 'buy') or o.is_fully_realized or - (o.status in NON_OPEN_EXCHANGE_STATES)): + (o.status not in NON_OPEN_EXCHANGE_STATES)): continue tmp_amount = o.amount @@ -745,7 +745,7 @@ class LocalTrade(): and o.ft_is_open is False and (o.filled or 0) > 0 and not o.is_fully_realized and - o.status not in NON_OPEN_EXCHANGE_STATES] + o.status in NON_OPEN_EXCHANGE_STATES] @property def nr_of_successful_buys(self) -> int: