Added error information output
This commit is contained in:
		@@ -30,7 +30,7 @@ async def start_trading_cycle(
 | 
			
		||||
        risk_management_data = await rq.get_user_risk_management(tg_id=tg_id)
 | 
			
		||||
        trade_mode = additional_data.trade_mode
 | 
			
		||||
        switch_side = additional_data.switch_side
 | 
			
		||||
        side= additional_data.side
 | 
			
		||||
        side = additional_data.side
 | 
			
		||||
        margin_type = additional_data.margin_type
 | 
			
		||||
        leverage = additional_data.leverage
 | 
			
		||||
        order_quantity = additional_data.order_quantity
 | 
			
		||||
@@ -107,7 +107,8 @@ async def start_trading_cycle(
 | 
			
		||||
                   "position idx not match position mode",
 | 
			
		||||
                   "Qty invalid",
 | 
			
		||||
                   "The number of contracts exceeds maximum limit allowed",
 | 
			
		||||
                   "The number of contracts exceeds minimum limit allowed"
 | 
			
		||||
                   "The number of contracts exceeds minimum limit allowed",
 | 
			
		||||
                   "Order placement failed as your position may exceed the max",
 | 
			
		||||
               }
 | 
			
		||||
            else None
 | 
			
		||||
        )
 | 
			
		||||
@@ -193,6 +194,7 @@ async def trading_cycle_profit(
 | 
			
		||||
                   "ab not enough for new order",
 | 
			
		||||
                   "InvalidRequestError",
 | 
			
		||||
                   "The number of contracts exceeds maximum limit allowed",
 | 
			
		||||
                   "Order placement failed as your position may exceed the max",
 | 
			
		||||
               }
 | 
			
		||||
            else None
 | 
			
		||||
        )
 | 
			
		||||
@@ -293,6 +295,7 @@ async def trading_cycle(
 | 
			
		||||
                   "ab not enough for new order",
 | 
			
		||||
                   "InvalidRequestError",
 | 
			
		||||
                   "The number of contracts exceeds maximum limit allowed",
 | 
			
		||||
                   "Order placement failed as your position may exceed the max",
 | 
			
		||||
               }
 | 
			
		||||
            else None
 | 
			
		||||
        )
 | 
			
		||||
@@ -363,6 +366,7 @@ async def open_positions(
 | 
			
		||||
            "Qty invalid": "Qty invalid",
 | 
			
		||||
            "The number of contracts exceeds maximum limit allowed": "The number of contracts exceeds maximum limit allowed",
 | 
			
		||||
            "The number of contracts exceeds minimum limit allowed": "The number of contracts exceeds minimum limit allowed",
 | 
			
		||||
            "Order placement failed as your position may exceed the max": "Order placement failed as your position may exceed the max",
 | 
			
		||||
        }
 | 
			
		||||
        for key, msg in known_errors.items():
 | 
			
		||||
            if key in error_text:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user