In Python/mt5, my order request returned an error New comment AYMERIC75 2023.04.19 11:30 Hello, With this code: request = { "action": MetaTrader5.TRADE_ACTION_PENDING, "symbol": "BTCUSD", "volume": 0.01, "type": mt5.ORDER_TYPE_BUY, "price": round(price, 3), "type_filling": MetaTrader5.ORDER_FILLING_RETURN, "type_time": MetaTrader5.ORDER_TIME_GTC, "comment": "some comment" } # Send the order to MT5 order_result = MetaTrader5.order_send(request) # Notify based on return outcomes if order_result[0] == 10009: print(f"Order for {symbol} successful") else: print(f"Error placing order. ErrorCode {order_result[0]}, Error Details: {order_result}") I get an error (Error placing order. ErrorCode 10013 Do you have any idea why this is happening ? Thanks Error placing order. ErrorCode [Deleted] 2023.04.19 11:32 #1 Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Trade Server Return Codes 10013 TRADE_RETCODE_INVALID Invalid request AYMERIC75 2023.04.19 12:39 #2 Thanks, but it does not tell me what is the issue exactly :) Tanapat Kamsai In 2023.05.18 16:57 #3 got the same error sir, please let me know what is the main reason here. Alain Verleyen 2023.05.18 17:56 #4 avakx1234 #: got the same error sir, please let me know what is the main reason here. Please show your code if you need coding help. New comment
Hello,
With this code:
request = { "action": MetaTrader5.TRADE_ACTION_PENDING, "symbol": "BTCUSD", "volume": 0.01, "type": mt5.ORDER_TYPE_BUY, "price": round(price, 3), "type_filling": MetaTrader5.ORDER_FILLING_RETURN, "type_time": MetaTrader5.ORDER_TIME_GTC, "comment": "some comment" } # Send the order to MT5 order_result = MetaTrader5.order_send(request) # Notify based on return outcomes if order_result[0] == 10009: print(f"Order for {symbol} successful") else: print(f"Error placing order. ErrorCode {order_result[0]}, Error Details: {order_result}")I get an error (Error placing order. ErrorCode 10013
Do you have any idea why this is happening ?
Thanks
Error placing order. ErrorCode