MQL4 ERROR 138

 
Good day guys! Am still learning coding with mql4 and I am stack with "Order close error 138" (description: Requote). Am trying to figure out how to correct, please any professional to help.
 
Check the return value of ordersend.
 
Sackaria Nakamela: Good day guys! Am still learning coding with mql4 and I am stack with "Order close error 138" (description: Requote). Am trying to figure out how to correct, please any professional to help.

You are probably using the wrong price for the operation!

Remember that Buy orders open at the Ask price and close at the Bid price, while Sell Orders open at the Bid price but close at the Ask price.

If that does not solve your problem, then post the code for analysis.

 
Marco vd Heijden:
Check the return value of ordersend.

Thankx, I got it right.

 
Fernando Carreiro:

You are probably using the wrong price for the operation!

Remember that Buy orders open at the Ask price and close at the Bid price, while Sell Orders open at the Bid price but close at the Ask price.

If that does not solve your problem, then post the code for analysis.

Your are perfectly correct sir. That was the problem i had. Thank you!

 

Hell guys i am learning how to create an EA and when I complied my codes i got a warning message saying 

return value of 'OrderSend' should be checked

please kindly help i have attached the image bellow


Files:
E_11_EA.jpg  6071 kb
Reason: