Get rid of delete_trades method in Freqtradebot

This commit is contained in:
hroff-1902 2020-02-14 04:05:17 +03:00
parent 2dea362eda
commit 36ef5c6bdf

View File

@ -860,11 +860,6 @@ class FreqtradeBot:
order_type = self.strategy.order_types['sell'] order_type = self.strategy.order_types['sell']
self._notify_sell_cancel(trade, order_type) self._notify_sell_cancel(trade, order_type)
def delete_trade(self, trade: Trade) -> None:
"""Delete trade in database"""
Trade.session.delete(trade)
Trade.session.flush()
def handle_timedout_limit_buy(self, trade: Trade, order: Dict) -> bool: def handle_timedout_limit_buy(self, trade: Trade, order: Dict) -> bool:
""" """
Buy timeout - cancel order Buy timeout - cancel order
@ -882,7 +877,8 @@ class FreqtradeBot:
if corder.get('remaining', order['remaining']) == order['amount']: if corder.get('remaining', order['remaining']) == order['amount']:
# if trade is not partially completed, just delete the trade # if trade is not partially completed, just delete the trade
self.delete_trade(trade) Trade.session.delete(trade)
Trade.session.flush()
return True return True
# if trade is partially complete, edit the stake details for the trade # if trade is partially complete, edit the stake details for the trade