The MetaTrader5 terminal is slowly but surely replacing MetaTrader4. To some extent, this trend is supported by the MetaQuotes company itself, which increases the cost of the licensed “four”. Still, one cannot ignore the fact that any software product is gradually developing. Against this background, traders are increasingly asking the question – how to add an indicator to MT5?
First of all, I would like to remind you of one important nuance – the programming language in which all MetaTrader5 applications are created differs from the MetaTrader4 language. However, it may seem to a non-professional that their operators and variables are identical.
This means that only those indicators with the mq5 or ex5 extensions are suitable for installation in MT5, and all algorithms with the mq4 / ex4 formats will have to be rewritten anew.
But back to the topic. Suppose a user has already installed MetaTrader5 and opened a corresponding demo account. How to add an indicator to MT5?
What do you need to do to add an indicator to MT5?
For everything to work out the first time and without errors, the first step is to find a folder on your hard drive where the algorithms are loaded. To do this, go to the “File” program menu and select the “Open data directory” command there.
This action will open the main folder, which contains the main work units. As a rule, during the terminal installation, it is automatically created on the system disk, so it is almost impossible to find it manually.
Next, you need to open the “MQL5” directory. By its name, you can already guess that all files related to the same name’s programming language are collected here, and the “Indicators” folder already gives a clear hint on how to proceed.
And here, I want to immediately warn beginners against rash actions. The point is that the answer to the question “how to add an indicator to MT5?” depends on a set of source documents obtained from the application developer or downloaded from the network.
In particular, add-ons of the following formats can go along with mq5 / ex5 files:
- txt, CSV, xls, etc. – these are various text notes and tables from which some experts read information;
- mqh are so-called “include files”, they are often used to protect source code and give it a more representative look;
- dll – libraries, content, information about various functions, both user-defined and standard.
Thus, if a trader only has a necessary mq5 / ex5 file, it should already be clear how to add an indicator to MT5 – copy it to the “Indicators” folder.
Additional files for added MT5 indicators
If the archive contains additional files, they need to be divided into the appropriate subcategories.
After copying, the MetaTrader5 terminal should be restarted. This operation is necessary for the built-in compiler to generate the required objects and bring the new Expert Advisor to the “navigator”.
By the way, since the word “compiler” has been mentioned, I would like to remind you of one feature of Expert Advisors written in the MQL5 language. As everyone remembers, they are of two types – mq5 and ex5.
The former is the source code, i.e., they can be modified, improved, supplemented with auxiliary functions, etc. For the user, they are of particular value, as they literally “untie their hands.”
But the second format is nothing more than a compiled mq5 file, i.e., it is a ready-made program that cannot be changed. Thus, if a trader only has ex5 at his disposal, he may face the following problems:
- The indicator will sooner or later stop working correctly, as the MetaTrader developers periodically make changes to their platform;
- The user will not be able to evaluate the formula based on which the algorithm builds its calculations;
- There are often problems with automation, i.e., it is better to create an auxiliary advisor that reads the signals of the algorithm based on the source code.
Newbies also often ask, they say, how to add an indicator to MT5, if after installation, it does not appear in the navigator? Unfortunately, this situation indicates that a critical error occurred during the compilation process, due to which the program was unable to convert mq5 to ex5.
To eliminate any doubts, you can even manually see where the problem appears. To do this, you first need to double-click on the indicator name with the left mouse button. As a result, MetaEditor should start automatically.
Please note – there is a large “Compile” button in the upper panel of this window. To search for a failure, click on it and wait for the reaction.
In my example, the editor found one critical error, located at line 165 of the code. It does not allow the compiler to convert the “source” into the desired format, so then there are two options – to solve the problem yourself or ask the programmers to help with the misfortune.
And since we are talking about malfunctions in the installed algorithms, I want to remind you of one detail – if there is a library in the kit, you need to enable DLL import in the MetaTrader5 settings.
In principle, users quickly figure out how to add an indicator to MT5, i.e., the possible problems that I talked about today are bypassed by many traders, but, as they say, forewarned is forearmed.