All Expert Advisors created by EA Coder display a special error message code on MT4 charts when an error occurs during the open, close or modification phase of an order. If you see a message like ‘oe131’ on your chart when a new trade was supposed to be opened, you’ll know that an error has occurred.

Types of error message codes

Error message codes always start with two letters followed by an error code number. The error codes I use are the same as those used in the MQL4 programming language and are explained in detail on the MQL4 documentation page.

Error codes may start with oe, me or ce.

oe stands for “open error“, me stands for “modify error“, and ce stands for “close error“.

MT4 chart with error message code and a trade delay indicator

When an error occurs during trade open

Take our previous example oe131. Now we know that it indicates an error during a trade open, with the code 131. If you look at the full list of error code descriptions, this one means “invalid trade volume”, which alerts us to check the money management settings that we have set for the Expert Advisor. This kind of error appears when a lot size is zero, if it is too small or if it is too big, because all brokers have lot size limitations. Some do not allow the lot size to be smaller than 0.1 while others allow lot sizes as low as 0.01. This varies among different brokers and different account types.

Usually Expert Advisors from EA Coder fix the lot size according to the broker limitations, but exceptions may apply because not all brokers report the correct limitation values for the EAs. An example of this is a broker reporting the minimum allowed lot size to be 0.01 while in reality it is actually 0.1. In a case like this, if you to set the EA to use a lot size somewhere between 0.01 and 0.09 it will fail to place orders as it won’t be able to fix the lot size because of it being reported incorrectly. Then you will get the oe131 error message printed on the chart.

Another example would be to get the oe133 error. This stands as “Trade is disabled” and it means that the broker does not allow to trade that pair. If this error appears even when customer tries to open trade manually on the same chart, then MT4 EA should be attached to a similar pair with the suffix. For example if you get this error on EURUSD, please look for pair name like EURUSDm or EURUSDFXF.

If you are able to open trades manually on the same pair it could be that your broker does not allow to use trading robots (EA’s) on that pair or account. Contact them for more info.

Common trade open errors:

  • 128 – Trade timeout.
  • 129 – Invalid price.
  • 130 – Invalid stops.
  • 131 – Invalid trade volume.
  • 133 – Trade is disabled.
  • 134 – Not enough money.
  • 146 – Trade context is busy.

When an error occurs during order modification

Let’s take a look at another common error that you may receive. It would be printed on your chart as me130 which stands for “modify error 130” and means “invalid stops”. This tells us that the stop loss and/or take profit values are incorrect or too close to the current market price. The minimum distance between the market and stop prices are called StopLevel limitation; this value simply tells the EA what size in pips the limitation is. On 5 digit brokers this is reported as points and must be converted to pips. However that is something the user don’t need to worry about, because EA Coder Expert Advisors handle these things automatically. But if you get a me130 error, be sure to check the TP and SL values that you’re using.

Common trade modification errors:

  • 128 – Trade timeout.
  • 130 – Invalid stops.
  • 146 – Trade context is busy.

When an error occurs during trade close

You may get a ce146 error when EA tries to close an order. This indicates that a “close error” occurred whose code is 146. This means “trading context busy” and it is very common error, specially on older MT4 terminals when you have multiple Expert Advisors attached. EA Coder robots have an intelligent error handling mechanism built in and will do their best to avoid “trading context busy” errors even if you have multiple robots operating on your account. But in case you get one of these errors, just try to minimize the number of EAs running on the same account or set them to avoid performing trading operations at the same time if that’s possible with your EA.

Common trade close errors:

  • 128 – Trade timeout.
  • 146 – Trade context is busy.

Delaying of trading operations

EA may need to delay a trading operation to avoid disrupting the MQL programming rules when an error occurs. It will retry the same trading operation if required and will have to wait somewhere between 1 to 5 seconds between each attempt. These are very logical rules of Metatrader programming and EA Coder trading robots obey them. See full list of execution errors.

In case there is a delay in performing a trading operation (whether it is opening, modifying or closing a trade) EA will print a small clock picture on the chart. This indicates that there was some kind of error and EA had to delay its operation for a few seconds to obey the rules and not overload the brokers’ servers.

Experts tab in MT4 terminal

When any error occurs, the EA will print a more detailed error message in the Experts tab at the bottom of the MT4 terminal. You can switch to that tab any time and scroll down to see a complete list of errors, warnings and informational messages. These can help to solve a range of problems quickly even if you don’t have a lot of experience in using the MT4 platform and Expert Advisors or custom indicators.

Error messages in the Experts tab of the MT4 client terminal

Opening the log files folder directly from an MT4 terminal

When you’re viewing the Experts tab you can click the right mouse button anywhere in that area and choose “Open”. This will open the log files folder for you. This folder contains files with the same messages that you see in the Experts tab, but from here you can access messages from previous days and weeks. Also, messages in the log files are presented in their full format and are not trimmed like some of the messages shown in the Experts tab when they are too long.

Open MT4 Experts log files folder easily

MT4 Experts log files folder

Reporting an error to EA Coder

When you need to report an error to EA Coder, please describe the problem you are having in detail, include the trade numbers that you are having problems with, and make sure you attach any necessary files. It is very important that you send the log files from your \MT4-folder\experts\logs\ so that I’m able to investigate an error. Also please include screen shots of the chart where EA is running and if possible make sure that the problem is visible in the picture. This will help us provide you with more useful support.

You might notice that your log files folder is empty or doesn’t have any recent log files (the file names indicate the date they were created). In this case please carry out the steps described above which detail how to open the log files folder directly from the Experts tab at the bottom of your MT4 terminal.

Before you report a problem or request support for learning how an EA feature works, please refer to the instructional manual. This may help you solve your problem faster and you will also learn how to use the application better.

Order labeling during EA backtest

Our Expert Advisors have a special order labeling mechanism built in. It is activated when you run EA in the Strategy Tester of your MT4 and it will create label numbers for each order that is placed during a backtest. This helps to track your trades easily as you will see the order numbers above each trade on the chart.

Trade numbering when EA runs in MT4 strategy tester

[mailchimp-article-newsletter]

Rimantas Petrauskas
Rimantas Petrauskas

First I am a father, a husband and then the author of the book “How to Start Your Own Forex Signals Service”. I am also a Forex trader, a programmer, an entrepreneur, and the founder of ea-coder.com Forex blog. I have created two of the most popular trade copiers and other trading tools for MT4 that are already used world wide by hundreds of currency traders.

    6 replies to "Expert Advisor error message codes on chart"

    • noah

      my fxopen mt4 forex is reporting invalid volumn. i try all the leverage sieze and open the highest demo balance but the same message keep on reporting. why?

      my MFIforex platform still mt4 has refuse to update or connect to the network.what can i do i will to open live account after this test running this demo but now am discorrage

      • Rimantas Petrauskas

        Dear Noah,

        it is truly difficult to solve your problem when I do not know if you are using EA created by me or by someone else.
        However, I think you have this problem when EA does not prepare the right lot size. For example if your EA use lot size of 0.15 and your broker allows lot sizes only by increments of 0.1 you will get “invalid volume” error. In this case you can use lot sizes like this 0.1, 0.2, 0.3, 0.4, etc.
        If your broker allows lot sizes by increments of 0.01, then 0.15 lot size should work just fine if there is enough money in your account.

        All EA’s that I create automatically detect these settings from the broker and prepares the lot size avoid such error.

        You may want to take a look at the “Experts” tab or log files for more error messages. Maybe there is an explanation of the exact lot size printed after it got rejected by the broker.

        Hope this helps.

        Regards,
        Rimantas Petrauskas

    • Willy

      Hi, Thank you for the help.

      In the expert advisor journal it says : trying to close short position, however there is no short position opened. how to solve that?
      thanks

      • Rimantas Petrauskas

        Dear Willy, you need to contact creator of the EA to get an answer to this question. If it is me, then contact me here.
        But this message sounds like you can ignore it. EA probably has a rule to close all trades and simply checks to close SHORT trades when it gives this message. If there are any SHORT trades EA must be closing them, if there are no trades, it just does nothing.

        Regards, Rimantas Petrauskas

    • Roberto Dasso

      Hi Mr Petrauskas. I have coded an EA that is performing reasonable well but I am receiving the error code 2 message = which stands for common error. Do you know what could be the reason for this error?

      This error appeared after a series of trades have been closed correctly, and then a new trade should have been opened but the Error appeared. At that point 212 trades were succesfully opened and closed.

      2019.06.15 10:21:25.358 2019.05.23 18:52:27 Grid TDI EA 5.00 USDCHF,H4: Common error
      2019.06.15 10:21:25.358 2019.05.23 18:52:27 Grid TDI EA 5.00 USDCHF,H4: OrderSend error 2
      2019.06.15 10:21:25.358 2019.05.23 18:52:25 Grid TDI EA 5.00 USDCHF,H4: Common error
      2019.06.15 10:21:25.358 2019.05.23 18:52:25 Grid TDI EA 5.00 USDCHF,H4: OrderSend error 2
      2019.06.15 10:21:25.358 2019.05.23 18:52:25 Tester: take profit #212 at 1.00416 (1.00414 / 1.00416)
      2019.06.15 10:21:23.925 2019.05.23 18:28:06 Grid TDI EA 5.00 USDCHF,H4: No error
      2019.06.15 10:21:23.925 2019.05.23 18:28:06 Grid TDI EA 5.00 USDCHF,H4: modify #212 sell 49.63 USDCHF at 1.00476 sl: 1.04476 tp: 1.00416 ok

      Any idea what could have happened?

Leave a Reply

Your email address will not be published.