I am trying to figure out why every pending order is being cancelled right away after placing it successfully in the market. The error message the EA is returning is the following: "Error Code: 10013 [Invalid Request]"
Here is the log where you can see the messages from the server:
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I am trying to figure out why every pending order is being cancelled right away after placing it successfully in the market. The error message the EA is returning is the following: "Error Code: 10013 [Invalid Request]"
Here is the log where you can see the messages from the server:
RQ 0 17:21:02.223 Trades '1520355161': sell stop 1 XAUUSD at 2450.69 sl: 2475.20 tp: 2401.68
EF 0 17:21:02.366 Trades '1520355161': accepted sell stop 1 XAUUSD at 2450.69 sl: 2475.20 tp: 2401.68
GF 0 17:21:02.371 Trades '1520355161': order #31994308 sell stop 1 / 1 XAUUSD at 2450.69 done in 148.542 ms
OQ 0 17:21:02.435 Trades '1520355161': cancel order #31994308 sell stop 1 XAUUSD at 2450.69 sl: 2475.20 tp: 2401.68
PR 0 17:21:02.488 Trades '1520355161': accepted cancel order #31994308 sell stop 1 XAUUSD at 2450.69 sl: 2475.20 tp: 2401.68
ML 0 17:21:02.490 Trades '1520355161': cancel #31994308 sell stop 1 XAUUSD at market done in 54.933 ms
Here is the code: