Reduce spammyness of parcial cancel orders

This commit is contained in:
Matthias 2020-05-17 10:53:07 +02:00
parent 1e76bff1bd
commit dd55d2eea3

View File

@ -879,10 +879,10 @@ class FreqtradeBot:
logger.info('Cannot query order for %s due to %s', trade, traceback.format_exc()) logger.info('Cannot query order for %s due to %s', trade, traceback.format_exc())
continue continue
trade_state_update = self.update_trade_state(trade, order) fully_cancelled = self.update_trade_state(trade, order)
if (order['side'] == 'buy' and ( if (order['side'] == 'buy' and (
trade_state_update fully_cancelled
or self._check_timed_out('buy', order) or self._check_timed_out('buy', order)
or strategy_safe_wrapper(self.strategy.check_buy_timeout, or strategy_safe_wrapper(self.strategy.check_buy_timeout,
default_retval=False)(pair=trade.pair, default_retval=False)(pair=trade.pair,
@ -891,7 +891,7 @@ class FreqtradeBot:
self.handle_cancel_buy(trade, order, constants.CANCEL_REASON['TIMEOUT']) self.handle_cancel_buy(trade, order, constants.CANCEL_REASON['TIMEOUT'])
elif (order['side'] == 'sell' and ( elif (order['side'] == 'sell' and (
trade_state_update fully_cancelled
or self._check_timed_out('sell', order) or self._check_timed_out('sell', order)
or strategy_safe_wrapper(self.strategy.check_sell_timeout, or strategy_safe_wrapper(self.strategy.check_sell_timeout,
default_retval=False)(pair=trade.pair, default_retval=False)(pair=trade.pair,
@ -1126,6 +1126,11 @@ class FreqtradeBot:
""" """
Sends rpc notification when a sell cancel occured. Sends rpc notification when a sell cancel occured.
""" """
if trade.sell_order_status == reason:
return
else:
trade.sell_order_status = reason
profit_rate = trade.close_rate if trade.close_rate else trade.close_rate_requested profit_rate = trade.close_rate if trade.close_rate else trade.close_rate_requested
profit_trade = trade.calc_profit(rate=profit_rate) profit_trade = trade.calc_profit(rate=profit_rate)
current_rate = self.get_sell_rate(trade.pair, False) current_rate = self.get_sell_rate(trade.pair, False)