Skip to content

Commit

Permalink
Get rid of delete_trades method in Freqtradebot
Browse files Browse the repository at this point in the history
  • Loading branch information
hroff-1902 committed Feb 14, 2020
1 parent 2dea362 commit 36ef5c6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions freqtrade/freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,11 +860,6 @@ def check_handle_timedout(self) -> None:
order_type = self.strategy.order_types['sell']
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:
"""
Buy timeout - cancel order
Expand All @@ -882,7 +877,8 @@ def handle_timedout_limit_buy(self, trade: Trade, order: Dict) -> bool:

if corder.get('remaining', order['remaining']) == order['amount']:
# if trade is not partially completed, just delete the trade
self.delete_trade(trade)
Trade.session.delete(trade)
Trade.session.flush()
return True

# if trade is partially complete, edit the stake details for the trade
Expand Down

0 comments on commit 36ef5c6

Please sign in to comment.