Fixed
This commit is contained in:
@@ -7,7 +7,9 @@ logging.config.dictConfig(LOGGING_CONFIG)
|
||||
logger = logging.getLogger("close_positions")
|
||||
|
||||
|
||||
async def close_position(tg_id: int, symbol: str, side: str, position_idx: int, qty: float) -> bool:
|
||||
async def close_position(
|
||||
tg_id: int, symbol: str, side: str, position_idx: int, qty: float
|
||||
) -> bool:
|
||||
"""
|
||||
Closes all positions
|
||||
:param tg_id: Telegram user ID
|
||||
@@ -38,12 +40,17 @@ async def close_position(tg_id: int, symbol: str, side: str, position_idx: int,
|
||||
logger.info("All positions closed for %s for user %s", symbol, tg_id)
|
||||
return True
|
||||
else:
|
||||
logger.error("Error closing all positions for %s for user %s", symbol, tg_id)
|
||||
logger.error(
|
||||
"Error closing all positions for %s for user %s", symbol, tg_id
|
||||
)
|
||||
return False
|
||||
except Exception as e:
|
||||
logger.error("Error closing all positions for %s for user %s: %s", symbol, tg_id, e)
|
||||
logger.error(
|
||||
"Error closing all positions for %s for user %s: %s", symbol, tg_id, e
|
||||
)
|
||||
return False
|
||||
|
||||
|
||||
async def cancel_order(tg_id: int, symbol: str, order_id: str) -> bool:
|
||||
"""
|
||||
Cancel order by order id
|
||||
|
Reference in New Issue
Block a user