Understanding MetaEditor Folders

If you are getting familiar with Metatrader and are taking your first steps into developing your own tools, you will find this useful. In this article you will learn the different MetaEditor folders and their function.

Understanding MetaEditor and its Folders

What is MetaEditor

If you don’t already know, MetaEditor is the IDE (Integrated Development Environment) of MetaTrader.

An IDE is a tool that developers use to assist in the development and management of their code and programs.

When you download and install MetaTrader, either MT4 or MT5, this also includes MetaEditor with it.

You may wonder why, but the answer is really simple: MetaTrader success and popularity is also due to its automation and custom development capabilities. For this reason MetaTrader already comes with MetaEditor IDE, so you can create your own tools!

So, again, if you install Metatrader you will also install MetaEditor with it, by default.

You can find MetaEditor in either the start menu after the install, or in the Metatrader folder.

The most common way to load MetaEditor is by clicking the IDE icon in the MT5 client.

Metaeditor-Folders-4

The executable to run it is Metaeditor64.exe.

Metaeditor-Folders-1

What to use MetaEditor for?

MetaEditor is an IDE so it helps developers coding and manage their programs.

In the case of MetaEditor the main purposes are:

  • Develop MQL5 programs
  • Autofill and highlight code
  • Compile the code
  • Debug
  • Manage MQL5 project files
  • Protect the code

Main Folders in MetaEditor

Now that you know what MetaEditor is and what you use it for, let’s move to the folders in it.

MetaEditor organizes files into specific folders based on their function. Let’s take a closer look at each of them:

FolderPurposeFile Types
ExpertsHosting Expert Advisors (EAs) for automated trading.mq5, .ex5
IndicatorsStandard and custom indicators for market analysis.mq5, .ex5
ScriptsStores one-time execution programs.mq5, .ex5
LibrariesHolds precompiled reusable functions and utilities.ex5
IncludeKeeps reusable code snippets and configurations.mqh
FilesStores external files accessible by MQL5 programs.csv, .txt, images, etc.
ImagesContains image files for use in custom interfaces.bmp, .png

Folders look like this in MetaEditor.

Metaeditor-Folders-3

If you want to find the actual folders in the file system with Windows Explorer you can go in File > Open Data Folder > Enter the MQL5 folder.

Metaeditor-Folders-2

You can also explore the official documentation on the MetaTrader website.

Let’s break down these folders in more detail.

Experts Folder

The Experts folder is where you store your Expert Advisors, which are automated trading programs that run on your charts. EAs analyze market conditions and execute trades based on your predefined strategy.

These programs use .mq5 files for source code and compile into .ex5 files for execution. Keeping your EAs here ensures they’re easily accessible from the MetaTrader 5 platform.

Common Uses:

  • Automated trading strategies
  • Risk management systems
  • Trade execution and management tools

Indicators Folder

The Indicators folder contains custom indicators that assist with market analysis.

Unlike EAs, indicators don’t execute trades, they provide visual cues and data to help traders make informed decisions.

These also start as .mq5 source files and compile into .ex5 executable files.

Common Uses:

  • Moving averages
  • Trend lines
  • Oscillators and custom signals

Scripts Folder

The Scripts folder holds one-time execution programs.

Scripts run once, perform a task, and terminate, making them perfect for quick operations.

Common Uses:

  • Placing bulk orders
  • Closing all positions
  • Exporting historical data

Libraries Folder

The Libraries folder stores precompiled reusable functions and utilities.

Libraries are written in .mq5 but compile into .ex5 files, making them accessible without exposing their source code.

This is ideal for performance optimization and protecting proprietary logic.

Common Uses:

  • Mathematical calculations
  • Trade execution functions
  • Risk management modules

Include Folder

The Include folder contains reusable code snippets and configurations.

Unlike libraries, include files remain as .mqh source files and are compiled with the main program that calls them.

Common Uses:

  • Configuration settings
  • Helper functions
  • Modularizing large projects

Files Folder

The Files folder holds external resources accessible by your MQL5 programs.

This can include CSV files, text files, and other data formats.

Common Uses:

  • Storing historical data
  • Configuration files
  • Importing/exporting trade data

Images Folder

The Images folder is used for graphical resources that enhance your program’s visual interface.

Common Uses:

  • Custom icons
  • Interface graphics
  • Visual enhancements for indicators

Why Folder Structure Matters

A well-organized MetaEditor workspace offers several advantages:

  • Organization: Grouping files by type makes them easy to locate and manage.
  • Reusability: Libraries and include files reduce code duplication and keep your codebase DRY (Don’t Repeat Yourself).
  • Efficiency: Storing external files separately keeps your main programs clean and focused.
  • Security: Libraries compiled into .ex5 files protect your proprietary code from being copied or modified.

Best Practices for Managing MetaEditor Folders

  • Stick to Folder Conventions: Use the default folders to avoid confusion and ensure MetaTrader recognizes your programs.
  • Use Meaningful File Names: Clear, descriptive names make it easier to identify scripts, indicators, and libraries.
  • Keep Code Modular: Use include files and libraries for reusable functions to simplify maintenance and updates.
  • Backup Your Work: Regularly back up your MetaEditor directory to prevent data loss.

Conclusion

Understanding the MetaEditor folder structure is key to managing your MQL5 projects efficiently.

By keeping your work organized and following best practices, you’ll save time, reduce errors, and make your development process far more productive.

For further questions or feedback please Contact Us.

Metatrader Program Types

What is MQL5 and What it is Used For

Leave a Comment