How To Write An Indicator

Table of contents:

How To Write An Indicator
How To Write An Indicator

Video: How To Write An Indicator

Video: How To Write An Indicator
Video: Tradingview Tutorial | Making an Indicator from scratch 2024, November
Anonim

Indicators are often used to implement trading strategies when working on the interbank Forex market. There are a number of ready-made and proven indicators built into the MetaTrader trading terminal. But if you need to implement an author's strategy, you can create a custom indicator yourself using the built-in capabilities of the MetaQuotes Language (MQL) programming language.

How to write an indicator
How to write an indicator

Instructions

Step 1

Download, install and launch the MetaTrader trading terminal. To launch the editor of advisor programs, execute the "New" command of the "Navigator-Custom Indicators" window menu. Other ways to start the editor:

- execute the command "Service-Editor MetaQuotes Language";

- press the F4 button;

- click the corresponding MetaEditor button on the "Standard" panel. The above actions will automatically open the program editor.

Step 2

On the toolbar of the program editor, click the "New" button, which will open the wizard for creating advisor programs. Specify "Custom Indicator" as the type of the created program.

Step 3

Fill in the fields by entering the required data: indicator name, author's name, developer's website address or his email address.

Step 4

Adjust the parameters of the future indicator. To add a new parameter, click the "Add" button, to remove an unnecessary parameter, click the "Delete" button.

Step 5

Next, specify whether your custom indicator will be created in a separate window, and also specify the indicator boundaries. Set the number and characteristics of the indicator arrays (they are used to display lines on the exchange rate chart). After completing the specified actions, a new indicator window with the required parameters will open in the program editor.

Step 6

Proceed directly to writing the custom indicator program code.

Step 7

After writing the text of the program (in accordance with the strategy you have adopted), compile the indicator. To do this, press the F9 key, the button on the editor toolbar, or select the "File-Compile" menu. If there are no errors after compilation, an executable file in *. EX4 format is created. The list of custom indicators you have created is displayed in the "Navigator-Custom Indicators" window of the trading terminal.

Step 8

To overlay the indicator on the exchange rate chart, double-click on it in the "Navigator-Custom Indicators" window and click "OK".

Recommended: