Sometimes you would get an OrderSend Error 3 message in your experts log in MetaTrader 4. This can be a rather frustrating error because it prevents the order from executing (and position from opening). If you are an MQL coder you should learn how to fix it because it signifies that there is error in the logic of your expert advisor. If you are a simple Forex trader then there are some simple steps that you can do to fix this error if you have an .mq4 file of the EA. Here you’ll find out why OrderSend Error 3 occurs and how to fix it in MetaTrader.
The OrderSend Error 3 is called ERR_INVALID_TRADE_PARAMETERS internally in MT4 platform. ERR_INVALID_TRADE_PARAMETERS means that some of the parameters passed to OrderSend() function aren’t correct. By the way, this error may also appear with OrderModify() function (appears as OrderModify Error 3). The most popular cases are the following:
So what to do when you spot this OrderSend Error 3? First, check that the operation passed to the function is one of the following:
Then make sure that the slippage passed to the OrderSend() function isn’t negative. Slippage is often given as an input parameter, so you just enter some positive value there. Finally, if the error appears as OrderModify Error 3, make sure that the EA deals with the correct ticket number (maybe it’s trying to use 0 or -1). Just add this condition in front of the OrderModify() function in .mq4 file of the expert advisor:
if (ticket > 0)
where “ticket” is your variable for ticket number used in the function. It will cut all attempts to pass the most popular incorrect ticket numbers.
If you have any thoughts, comments or questions regarding MT4 Error 3 and the ways to treat it, feel free to reply to this post using the form below.