Removed TODO: change to exit-reason, exit_order_status

This commit is contained in:
Sam Germain 2021-09-09 13:14:48 -06:00
parent f5b01443ad
commit ee874f461c

View File

@ -1154,9 +1154,9 @@ class FreqtradeBot(LoggingMixin):
trade.orders.append(order_obj)
trade.open_order_id = order['id']
trade.sell_order_status = '' # TODO-lev: Update to exit_order_status
trade.sell_order_status = ''
trade.close_rate_requested = limit
trade.sell_reason = sell_reason.sell_reason # TODO-lev: Update to exit_reason
trade.sell_reason = sell_reason.sell_reason
# In case of market sell orders the order can be closed immediately
if order.get('status', 'unknown') in ('closed', 'expired'):
self.update_trade_state(trade, trade.open_order_id, order)
@ -1197,7 +1197,7 @@ class FreqtradeBot(LoggingMixin):
'current_rate': current_rate,
'profit_amount': profit_trade,
'profit_ratio': profit_ratio,
'sell_reason': trade.sell_reason, # TODO-lev: change to exit_reason
'sell_reason': trade.sell_reason,
'open_date': trade.open_date,
'close_date': trade.close_date or datetime.utcnow(),
'stake_currency': self.config['stake_currency'],
@ -1216,10 +1216,10 @@ class FreqtradeBot(LoggingMixin):
"""
Sends rpc notification when a sell cancel occurred.
"""
if trade.sell_order_status == reason: # TODO-lev: Update to exit_order_status
if trade.sell_order_status == reason:
return
else:
trade.sell_order_status = reason # TODO-lev: Update to exit_order_status
trade.sell_order_status = reason
profit_rate = trade.close_rate if trade.close_rate else trade.close_rate_requested
profit_trade = trade.calc_profit(rate=profit_rate)
@ -1240,7 +1240,7 @@ class FreqtradeBot(LoggingMixin):
'current_rate': current_rate,
'profit_amount': profit_trade,
'profit_ratio': profit_ratio,
'sell_reason': trade.sell_reason, # TODO-lev: trade to exit_reason
'sell_reason': trade.sell_reason,
'open_date': trade.open_date,
'close_date': trade.close_date,
'stake_currency': self.config['stake_currency'],