Deciphering the errors of advisers by code in the MT4 log (part 2)
In the previous review, we considered some of the most common errors in the operation of Expert Advisors, the code of which can be found in MT4 and MT5 in the Terminal in the “Experts” or “Journal” tab. Most of them are the discrepancy between the transactions opened by the robot and the broker’s trading conditions. They are corrected by correcting the code, but it is worth keeping in mind the fact: the trading conditions for different assets differ (indicated in the contract specifications). Therefore, it makes sense to optimize the advisor code for a specific asset of a specific broker. If you are going to use Expert Advisors, learn the basics of MQL, it will be difficult without them.
Errors of Expert Advisors: Codes and Decryption
- Error 147… Blocking a pending order by a broker due to a mismatch of the date of its automatic end with the current conditions. A discrepancy in the settings for placing a pending order by the EA.
What to do… Do not limit the validity period of a pending order, manually deleting it if necessary. Or set “0” in the OrderSend parameter in the Expert Advisor.
- Error 148… The number of market and pending orders opened by the advisor is the maximum in accordance with the broker’s conditions.
What to do… Close some orders or enlarge positions. It doesn’t always make sense to open 10 deals with a volume of 0.01 lots instead of one with a volume of 0.1 lots.
- Error 4012, 4013… Division by zero.
What to do… Look for an error in the advisor’s code. It is possible that there is some kind of floating value in the code, depending, for example, on the spread or swap. At some moments, it can be rounded to zero.
- Error 4017… Disallowing DLL calls.
What to do… In platform settings, allow DLL call. How – ask in the comments. Please note that activating this item increases the vulnerability of your computer – the risk of getting a virus on your computer increases.
- Error 4018, 4019… Unable to load library.
What to do… The files are damaged, deleted, have the wrong format. This error of the advisor can be eliminated by contacting the library developer. Or find a similar library in the public domain.
- Error 4020… Prohibiting calls to external library functions.
What to do… Activate this option in the platform in the settings, allowing the use of external data.
- Error 4103… The file cannot be opened.
What to do… The file used by the advisor cannot be opened. It can be damaged, missing or blocked by antivirus software. Read restrictions or extension errors may be set. If there is a file in the Experts folder, it is worth either overwriting it, or looking for the reason for blocking.
- Error 4106… Unknown symbol.
What to do… In the market overview in the platform, you can find all the symbols – the names of trading assets. This error in the EA operation means that it is focused on a symbol that the broker does not have. For example, the EA works with the EUR / USD pair, and the broker sets the symbol with the EUR / USDx suffix. This is not an error, but it prevents the EA from starting.
- Error 4108… Error in ticket.
What to do… The order that the advisor is referring to has been closed manually or by another advisor. In theory, this should not be the case – each order has a unique magic number that distinguishes the orders of the advisors, if they are launched together. But anything can happen.
- Error 4109… The Expert Advisor cannot be launched. Blocking by the terminal or broker.
What to do… In the platform, activate the function of the advisor in the settings. It didn’t help – ask the broker questions.
Most of the errors in the operation of advisors are related to the technical settings of the platform and code problems. If you have any questions or need help launching the advisor, write about it in the comments – we will try to help you!