mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-01-28 09:50:24 +00:00
feat: cancel orders of both sides in one go
This commit is contained in:
@@ -1782,9 +1782,12 @@ class FreqtradeBot(LoggingMixin):
|
||||
)
|
||||
return True
|
||||
else:
|
||||
# cancel open order of this trade if order is different
|
||||
# cancel open orders of this trade if order is different
|
||||
self.cancel_open_orders_of_trade(
|
||||
trade, [trade.entry_side], constants.CANCEL_REASON["REPLACE"], True
|
||||
trade,
|
||||
[trade.entry_side, trade.exit_side],
|
||||
constants.CANCEL_REASON["REPLACE"],
|
||||
True,
|
||||
)
|
||||
Trade.commit()
|
||||
return False
|
||||
@@ -2069,12 +2072,6 @@ class FreqtradeBot(LoggingMixin):
|
||||
if self.handle_similar_open_order(trade, limit, amount, trade.exit_side):
|
||||
return False
|
||||
|
||||
# cancel any open order of this trade
|
||||
self.cancel_open_orders_of_trade(
|
||||
trade, [trade.exit_side], constants.CANCEL_REASON["REPLACE"], True
|
||||
)
|
||||
Trade.commit()
|
||||
|
||||
try:
|
||||
# Execute sell and update trade record
|
||||
order = self.exchange.create_order(
|
||||
|
||||
Reference in New Issue
Block a user