feat: enhance cancel_all_orders method to include Algo order cancellation
- Updated the cancel_all_orders method to also cancel all Algo open orders in addition to regular open orders. - Added error handling to log warnings if the cancellation of Algo orders fails.
This commit is contained in:
@@ -129,10 +129,20 @@ class BinanceFuturesClient:
|
||||
return None
|
||||
|
||||
async def cancel_all_orders(self):
|
||||
"""일반 오픈 주문과 Algo 오픈 주문을 모두 취소한다."""
|
||||
loop = asyncio.get_event_loop()
|
||||
return await loop.run_in_executor(
|
||||
await loop.run_in_executor(
|
||||
None,
|
||||
lambda: self.client.futures_cancel_all_open_orders(
|
||||
symbol=self.config.symbol
|
||||
),
|
||||
)
|
||||
try:
|
||||
await loop.run_in_executor(
|
||||
None,
|
||||
lambda: self.client.futures_cancel_all_algo_open_orders(
|
||||
symbol=self.config.symbol
|
||||
),
|
||||
)
|
||||
except BinanceAPIException as e:
|
||||
logger.warning(f"Algo 주문 전체 취소 실패 (무시): {e}")
|
||||
|
||||
Reference in New Issue
Block a user