Authorised and Regulated: FCA UK / GLOBAL

How to Install a Metatrader 4 (MT4) Indicator

MetaTrader 4 (MT4) is a platform with a mission – it wants to make forex trading as simple and easy as possible. And to achieve this mission, it offers a plethora of features and functions, of which some of the most useful are Expert Advisors (EAs) and custom indicators. The best way to make an informed trading decision is to base that decision on an analysis of past and present price movements to predict a future trend. For this, traders use both fundamental and technical indicators. So, what part of this is simple and easy, you may ask?

Given the wide variety of technical indicators that are available on MT4, you need to choose which ones work best for you. And to be able to use your preferred indicators, you have been given the ability to create your own custom indicators. The EAs can then use these custom indicators to track trends and patterns and execute trades on your behalf. However, the key to being able to successfully use EAs and custom indicators is to install and launch them correctly. Fortunately, the process to create, setup and launch EAs and custom indicators (CIs) is the same on MT4, which is the first step in simplifying things for the user, isn’t it?

Installing MT4 Custom Indicators

Here are some simple steps that you can follow to install CIs:

  1. Open the Navigator window, and right click on Custom Indicators. From the dropdown menu that then opens, click on “Create.”
  2. This will open the ExpertAdvisor window, from which you need to select Custom Indicator (since this is what you want to create). After this click “Next.”
  3. When you click “Next,” it will open a new window – “General properties of the Custom Indicator program.” Here, you will need to fill in the following:
  • Name: You can name the custom indicator. Choose any name that is simple to remember and will help you remember what it is.
  • Author: This is the name of the developer
  • Link: You will need to provide the URL of the developer’s website, if applicable
  • Parameters: Here you will see a list of parameters on which to base your CI. To add a parameter to the CI, you will need to click on “Add.” However, for each parameter you choose to add, you will need to specify its Name, Type and Initial Value. If you change your mind about a parameter or do not want to include it, just click on “Delete.”

Once you’ve defined your CI with its parameters, click on “Next.”

4. Now another window will open, called “Drawing properties of the Custom Indicator program.” Your choices at this stage will determine what the CI looks like, the shape it takes, its color and so on. Click “Add” for all the drawing properties you include and when done, click on “OK.”

5. Yet another window opens at this stage, although this one is in the MQL4 programming language. So, what you see are a bunch of codes in a window that bears the name of your CI at the top right hand corner. You will see all the parameters you had chosen for the CI listed in this window. You will need to enter the CI code in this window using MQL4 language. If you are unsure about programming in this environment, check the Help Guides on MT4.

6. Once you complete the coding, make sure it is compiled to check if the code has been entered in the right format that enables the CI to run. To compile the CI, you will need to:

  • Choose File > Compile
  • Click on “Compile” in the toolbar
  • Use your keyboard to press F5

When compiling is initiated, you will see an update beneath the code, in a Toolbox. Any error that might have occurred will be shown here. Double click on the error to see it in code and fix. Once all errors are fixed, make sure you compile again.

6. Once compilation has been completed successfully, your new CI will show up in the Navigator – Custom Indicators window. However, if compilation was not successfully completed, the icon for your CI will be grey, which means you can’t use it. So, to be able to launch it, you will first need to ensure compilation success.

Launching the Custom Indicator

Before you can launch it, however, you also need to complete the setup. For this you will need to go to the Options window, where you should select “Expert Advisors.” For this, you can either go through Main Menu > Tools > Options or you could press CTRL + O on your keyboard.

Now you can choose between two options:

  1. Allow DLL imports: This will allow you to use DLLs to improve the functionality of the EA.
  2. Allow external experts imports: With this you can allow the EA to access functions from the MQL4 libraries or from other EAs.

Once you’ve made your choice of option, your CI is ready for launch. For this:

  • Go to the Navigator window and right click on Custom Indicator
  • In the Custom Indicator window, choose “Attach to a chart”
  • Go to the Navigator window and double click on Custom Indicator to do the same
  • Drag and drop your CI to the chart of your choice

When this is completed, a new window will open that gives you choices for “Common,” “Inputs,” “Colors” and “Visualization.” Check the settings for each of these and make the needed changes. Click “OK” when done and your CI will be attached to an active chart.


If you liked this educational article please consult our Risk Disclosure Notice before starting to trade. Trading leveraged products involves a high level of risk. You may lose more than your invested capital.