feat: cancel orders of both sides in one go
This commit is contained in:
@@ -1782,9 +1782,12 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
else:
|
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(
|
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()
|
Trade.commit()
|
||||||
return False
|
return False
|
||||||
@@ -2069,12 +2072,6 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
if self.handle_similar_open_order(trade, limit, amount, trade.exit_side):
|
if self.handle_similar_open_order(trade, limit, amount, trade.exit_side):
|
||||||
return False
|
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:
|
try:
|
||||||
# Execute sell and update trade record
|
# Execute sell and update trade record
|
||||||
order = self.exchange.create_order(
|
order = self.exchange.create_order(
|
||||||
|
|||||||
Reference in New Issue
Block a user