OrderSend doesn't work in debug mode when breakpoint exists

 

I tried lots of times and it always failed with error code 10009. When all breakpoints removed, it succeed. Is this normal case or some parameters need to be changed?  


Thanks a lot~

 
Luo Tiger :

I tried lots of times and it always failed with error code 10009. When all breakpoints removed, it succeed. Is this normal case or some parameters need to be changed?  


Thanks a lot~

Why did you decide that this is a mistake? I recommend to study the documentation: Trade Server Return Codes

Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Trade Server Return Codes
Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Trade Server Return Codes
  • www.mql5.com
Trade Server Return Codes - Codes of Errors and Warnings - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Hi Vladimir Karputov ,


Thanks for ur reply. Pls ignore 10009  code. 

I added error handler as follows:

 int state = OrderSend(request,result);
         if(!state)
           {
            PrintFormat("OrderSend error %d",GetLastError());
           }
        }

Then Irepeated the process, and it prompted as follows: 

2022.04.06 00:00:55.991 placeorder (EURUSD,H1) OrderSend error 4756. 



 
Luo Tiger # :

Hi Vladimir Karputov  ,


Thanks for ur reply. Pls ignore 10009   code. 

I added error handler as follows:

Then Irepeated the process, and it prompted as follows: 

2022.04.06 00:00:55.991 placeorder (EURUSD,H1) OrderSend error 4756. 


See error description here: Runtime Errors

Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Runtime Errors
Documentation on MQL5: Constants, Enumerations and Structures / Codes of Errors and Warnings / Runtime Errors
  • www.mql5.com
Runtime Errors - Codes of Errors and Warnings - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Vladimir Karputov #:

See error description here: Runtime Errors


Finally I get it out. MqlTradeRequest struct needs to be initialized :) 

Thanks anyway!