Русский 中文 Español Deutsch 日本語 Português
Upgrade to MetaTrader 4 Build 600 and Higher

Upgrade to MetaTrader 4 Build 600 and Higher

MetaTrader 4Examples | 5 March 2014, 11:25
20 697 1

On February 3, 2014 we released the new MetaTrader 4 build 600 with the completely revised MQL4 language and access to the Market of applications.

In addition to the updated MQL4 language for programming trading strategies, the new version of the MetaTrader 4 terminal provides a revised structore of user data storage. In earlier versions all programs, templates, profiles etc. were stored directly in the terminal installation folder. Now all necessary data required for a particular user are stored in a separate directory called data folder. However, some traders who have never worked with the latest versions of Windows may have question about the operation of the new terminal.

Upgrade to New MetaTrader 4

Here is an example of how to upgrade MetaTrader 4 build 509 to build 610. Suppose MetaTrader 4 build 509 is installed in Program Files system folder.

Before you start the update process, it is recommended that you make a backup copy of your current MetaTrader 4 terminal. You may use it later, in case you need transfer your files to another computer or to a new copy of the terminal.

Start the terminal and connect to any trading server where the new version is available, for example MetaTrader 4 will automatically start to download the update, during which numbers in the lower right corner will change to show the progress.

After the download is complete, "LiveUpdate: finished" appears in the "Terminal" window tab "Journal".

To complete the update restart the terminal manually. Close the terminal and run it again.

The new version of the terminal is easily distinguished from the previous one: MetaEditor icon has changed and a new tab "Market" with trading robots and indicators is now available.

If you have custom MQL4-programs, the following dialog box will appear after upgrade to the new version. It shows brief information about changes in the file structure of the terminal. All the details of the update are available in the terminal log.

Data Copied During the Upgrade

During the update, folders \config, \experts, \history, \logs, \profiles, \templates and \tester are transferred from the installation directory to the data folder.

Only standard folders and files are copied. Other ones are not copied even if they are located in folders \config, \experts, \history, \logs, \profiles, \templates, \tester.

User programs from the \experts folder are copied as follows:

Source folder in the installation directory
Content Destination folder in the terminal data directory
Expert Advisors (trading robots)
Note: only files from the root directory \experts are transfered. No subdirectories are transferred, because it is impossible to reliably determine their contents.
\experts\indicatorsCustom indicators
Scripts (MQL4 applications for a single run on the chart)<data_folder>\MQL4\Scripts
\experts\includeInclude MQH and MQ4 files<data_folder>\MQL4\Include
\experts\librariesMQ4 source code libraries and EX4 compiled files
\experts\filesSpecial "file sandbox". MQL4 applications are allowed to execute file operations only within this directory.<data_folder>\MQL4\Files
Log files of MQL4 applications
Set- configuration files for MQL4 applications
Image files

Please note that user programs are copied, but not migrated. After copying these MQ4/MQH/EX4 files are not deleted.

Programs from the previous standard terminal delivery pack are not copied during upgrade. Instead, new standard delivery programs are installed in the data folder.

You cab see the details of file migration process in the Journal of the MetaTrader 4 terminal.

These logs are also available in the *.log file of the Journal.

For more details please read the article Data Structure in MetaTrader 4 Build 600 and Higher.

What Is the Data Folder

The Data Folder is a special directory for storing files containing user data that change during operation of the MetaTrader 4 terminal build 600 and higher. For example, chart templates, profiles, set-files that contain input parameters of applications, source code and compiled EX4 files.

To go to the data folder from the terminal, open the "File" menu and click "Open Data Folder".

The root of each data folder contains the origin.txt file. This file shows the path to the installation directory of the terminal to which it relates.

What Is the Installation Folder

Terminal installation folder is the place on your computer that you have specified during terminal installation, or where you have placed the entire copy of the installed terminal. The installation folder contains files that will not change during operation, for example executable files terminal.exe and metaeditor.exe.

You can also see where the terminal installation folder is located in the properties of the desktop shortcut of the program via the context menu.

A click on "Open file location" in the context menu will open the installation folder.

General Mode of Terminal Start

In most cases, on computers running Windows Vista and higher, after upgrading from 509 to build 600 and higher, the data folder of the terminal will be located separately from the installation folder. The data directory is located in a separate folder in a special user folder if at least one of the following conditions are met:

  • User Account Control or UAC is enabled in Windows (starting with Windows Vista).
  • The user who runs the terminal has limited rights to write terminal data to the installation folder.
  • The user who runs the terminal works over a network connection (RDP).
The data folder will be located on the system drive in the following path:


  • С: is the name of a system disk;
  • User_account_name is the user's account for working in Windows;
  • Instance_id is the unique name of the folder where all the user's data for working with a certain copy of MetaTrader 4 terminal is stored. The unique name consists of 16 characters. The name is generated based on the path to the terminal installation folder, because the path to the terminal installation directory cannot be used explicitly as a folder name. A long unique name is used, because multiple copies of the terminal can be installed on one computer.

If the specified conditions are not met when you run the terminal, the data folder will be located in the installation folder.

Portable Mode

The Portable mode is active when you use the "/portable" key. This mode is used for running the terminal on portable data medium, in non-system directories, as well as on computers running Windows XP. For more convenience, you can create a separate terminal launch shortcut and write "/portable" in its properties.

When launched in the Portable mode, the terminal tries to save its data in the installation folder. However, using Portable mode does not guarantee that an operating system will allow storing data in the installation folder (for example, if the terminal is installed in Program Files directory and UAC is enabled).

The following conditions should be met for working in the Portable mode:

Installation directory
Operating System
Program Files or another system directory (for example, Windows)
Windows XP
Permission to write to the installation folder
Another non-system directory
Windows XP
Permission to write to the installation folder
External hard drive, usb flash drive, etc.Windows XPThe terminal will always be launched in Portable mode
Program Files or another system directory (for example, Windows)Windows Vista\Windows 7
Launching the terminal as administrator and disabled UAC
Another non-system directoryWindows Vista\Windows 7
Permission to write to the installation folder
External hard drive, usb flash drive, etc.Windows Vista\Windows 7The terminal will always be launched in Portable mode
Program Files or another system directory (for example, Windows)
Windows 8 and higher
It is impossible to use Portable mode, as UAC system cannot be disabled
Another non-system directoryWindows 8 and higher
Permission to write to the installation folder
External hard drive, usb flash drive, etc.Windows 8 and higherThe terminal will always be launched in Portable mode

How to run old EX4

In the previous version of the terminal, all user MQ4, MQH and EX4 files were stored in the \experts root folder. In the new MetaTrader 4 terminal version the root of the file structure for storing programs is \MQL4 in the data folder. During automatic copying user programs are transfered according to their type.

If an indicator or Expert Advisor does not appear in the terminal Navigator after the update, it means that the program is in a nonstandard location. Such programs should be copied manually into the appropriate subfolder in <data_folder>\MQL4.

Recompilation of old program files is not required. MQL4 application created in build 509 or older will run correctly in the new terminal version.

During the upgrade process files are copied to the new location, but old EX4 files are note recompiled. You should decide yourself whether to recompile your MQL4 applications.
We recommend that you read additional information at the following links:

Translated from Russian by MetaQuotes Ltd.
Original article:

Last comments | Go to discussion (1)
munwar shaikh
munwar shaikh | 30 Jun 2014 at 22:46
ms_trader_ buy sell
Common Errors in MQL4 Programs and How to Avoid Them Common Errors in MQL4 Programs and How to Avoid Them
To avoid critical completion of programs, the previous version compiler handled many errors in the runtime environment. For example, division by zero or array out of range are critical errors and usually lead to program crash. The new compiler can detect actual or potential sources of errors and improve code quality. In this article, we discuss possible errors that can be detected during compilation of old programs and see how to fix them.
Data Structure in MetaTrader 4 Build 600 and Higher Data Structure in MetaTrader 4 Build 600 and Higher
MetaTarder 4 build 600 features the new structure and location of the client terminal files. Now, MQL4 applications are placed in separate directories according to the program type (Expert Advisors, indicators or scripts). In most cases, the terminal data is now stored in a special data folder separated from the terminal installation location. In this article, we will describe in details how data is transferred, as well as the reasons for introducing the new storage system.
Why Is It Important to Update MetaTrader 4 to the Latest Build by August 1? Why Is It Important to Update MetaTrader 4 to the Latest Build by August 1?
From August 1, 2014, MetaTrader 4 desktop terminals older than build 600 will no longer be supported. However, many traders still work with outdated versions and are unaware of the updated platform's features. We have put a lot of effort into development and would like to move on with traders and abandon the older builds. In this article, we will describe the advantages of the new MetaTrader 4.
Offline Charts in the New MQL4 Offline Charts in the New MQL4
Updated MQL4 has the new format for storing historical data and provides the appropriate MqlRates structure for convenient storage of Time, Open, Low, High, Close and Volume values. For many years, traders have developed their MQL4 applications that collect and store their data in HST files for generating offline charts. We can assure you that all previously compiled EX4 files will work in the new MetaTrader 4 terminal the same way as before.