Русский 中文 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
21 164 1
MetaQuotes
MetaQuotes

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 demo.metaquotes.net. 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
\experts
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.
<data_folder>\MQL4\Experts
\experts\indicatorsCustom indicators
<data_folder>\MQL4\Indicators
\experts\scripts
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
<data_folder>\MQL4\Libraries
\experts\filesSpecial "file sandbox". MQL4 applications are allowed to execute file operations only within this directory.<data_folder>\MQL4\Files
\experts\logs
Log files of MQL4 applications
<data_folder>\MQL4\Logs
\experts\presets
Set- configuration files for MQL4 applications
<data_folder>\MQL4\Presets
\experts\images
Image files
<data_folder>\MQL4\Images

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:
C:\Users\<User_account_name>\AppData\Roaming\MetaQuotes\Terminal\Instance_id


where:

  • С: 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
Requirements
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: https://www.mql5.com/ru/articles/1389

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.
Working with GSM Modem from an MQL5 Expert Advisor Working with GSM Modem from an MQL5 Expert Advisor
There is currently a fair number of means for a comfortable remote monitoring of a trading account: mobile terminals, push notifications, working with ICQ. But it all requires Internet connection. This article describes the process of creating an Expert Advisor that will allow you to stay in touch with your trading terminal even when mobile Internet is not available, through calls and text messaging.
SQL and MQL5: Working with SQLite Database SQL and MQL5: Working with SQLite Database
This article is intended for developers who would be interested in using SQL in their projects. It explains the functionality and advantages of SQLite. The article does not require special knowledge of SQLite functions, yet minimum understanding of SQL would be beneficial.
MQL5 Programming Basics: Lists MQL5 Programming Basics: Lists
The new version of the programming language for trading strategy development, MQL [MQL5], provides more powerful and effective features as compared with the previous version [MQL4]. The advantage essentially lies in the object-oriented programming features. This article looks into the possibility of using complex custom data types, such as nodes and lists. It also provides an example of using lists in practical programming in MQL5.