What Is MetaEditor for MetaTrader 4? (2024)

If you are looking to modify or create new MQL4 code, you need to befamiliar with MetaEditor. It is the most important tool for MQL4 coders and is indispensable even if you want to make a small change to some source code.To better understand this guide, you must already know what MQL4 isand what MetaTrader is— these are the starting concepts.

What Is MetaEditor for MetaTrader 4? (1)

If you already have some experience with MetaTrader, the most populartrading platform, you have probably also heard about MQL4, the powerful scripting language that will improve your trading capabilities. For all the traders interested in coding with MQL4, the third main tool to know is MetaEditor. The word MetaEditor sounds similar to MetaTrader, but it focuses on Editor. Basically, MetaEditor is a dedicated Editor to develop, manage, and compile MQL4 programs. MQL4 is a scripting language and the source files are text files with extension MQ4 and MQH. Being text files, they can be opened with any text editor, for example Notepad++ or Wordpad. So why do we need MetaEditor? MetaEditor facilitates the tasks of creating and editing such files in the following ways:

  • Present the code in a well formatted and colored form, which is very easy to read.
  • Navigator panel to browse the files.
  • Option to insert coding elements like variables and functions.
  • Autocompletion to predict and suggest the word that is being typed.
  • Error highlighting.

One of the main functions of MetaEditor is the ability to compile the source files. This needs to be explained as not everyone has a clear idea what does it mean to compile a program. As you know, a computer is a very complex calculator, it perform mathematical operations in a binary system. The code that you write may make sense to you, but as it is in a source file, it does not make sense for a computer to run. This is because it needs to be compiled first!

Compilation is the task that takes a text source file, in this case with a MQ4 extension, and transforms it into an executable file, in this case with a EX4 extension. It can now be executed by a computer or another software. So, in other words, after you have created your source MQ4 file, you need to compile it to produce an executable EX4 file. Compiled files can be only run and not read, so you cannot retrieve the source code they have been created from.

MetaEditor is included in the installation of MetaTrader and is also kept updated by the same process that updates your MetaTrader. To open MetaEditor, you have fouroptions:

  • Option 1 - In MetaTrader, click the menu Tools and then click the MetaQuotes Language Editor option.What Is MetaEditor for MetaTrader 4? (2)
  • Option 2 - While in MetaTrader, press F4 button on your keyboard.
  • Option 3 - In the Standard toolbar, click the MetaEditor icon.What Is MetaEditor for MetaTrader 4? (3)
  • Option 4 - In the Windows Start Menu open the MetaTrader 4 group and select MetaEditor.What Is MetaEditor for MetaTrader 4? (4)

Once you open MetaEditor, the interface is quite intuitive. You can browse the files in the Navigator, save, open, compile, and run from the menu and toolbars, and check for errors, logs, articles, and additional code in the Toolbox. You will get familiar with it quickly.

What Is MetaEditor for MetaTrader 4? (5)

Now you should have a basic understanding of the tools required to automate your trading:

  • MetaTrader— to trade and run your code.
  • MQL4— the scripting language.
  • MetaEditor— to create, edit, and compile your code.

You should be ready to start learning how to code at this point.

If you want to get news of the most recent updates to our guides or anything else related to Forex trading, you can subscribe to our monthly newsletter.

What Is MetaEditor for MetaTrader 4? (2024)
Top Articles
Latest Posts
Article information

Author: Terrell Hackett

Last Updated:

Views: 6222

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.