Over the past 7 months since the release of the public build , we put in a lot of effort to improve MetaTrader 4 client terminal. MQL4 programming language for developing trading strategies has undergone the most significant changes - program execution speed has been increased, while the language itself has been brought closer to MQL5 to the maximum possible extent.
New MetaEditor provides such features as debugging, profiling, personal storage , autosubstitution of function names, snippets, inserting resources and intelligent code management. The new MetaTrader 4 terminal features the Market - store of protected applications for MetaTrader 4 terminal. Now, any developer can put his or her own trading programs for sale on the unified application store, while traders can buy any product right from the terminal. MQL4 application developers can set the number of activations and prices for their products without worrying about the technical issues related to sales process - MetaTrader 4 Market will take care about the latter.
Due to changes in the file structure and location of the directory for storing custom files indicators, Expert Advisors, scripts, templates, logs, etc.
Not a single custom file will be deleted during the process, and all original files will remain in their appropriate locations becoming backup copies. Microsoft Windows XP released 13 years ago allows applications to write their own data at the place of their installation even if the latter took place in Program Files system folder.
A user should only have an administrator permission to write data to any folder. Starting from Windows Vista, Microsoft has introduced a restriction on writing to Program Files directory.
All data should be located in a separate user directory. This limitation has been introduced in order to protect users against malicious programs and to prevent applications under one user account to change or damage the same program's data necessary for another user account. Since that time, security requirements in Microsoft operating systems have been tightening further. In particular, starting with Windows 8, UAC system cannot be disabled even if "Never notify" option is selected in its settings.
Microsoft has implemented virtualization process in order to provide compatibility with older applications when using UAC. If a program tries to save its data to Program Files directory, the data is actually physically saved to a separate folder having the following look - C: Microsoft claims that this mode has been provided only for compatibility and can be removed later.
In order to comply with Microsoft recommendations, the data storage structure has been changed in MetaTrader 4 client terminal starting from build Now, the terminal will also save its data in a user directory. In the new version, all data of a certain user working with a certain copy of MetaTrader 4 terminal are stored in a special place called terminal data folder. This folder can be found on a system disk a disk with installed Windows operating system along the following path.
The root of each terminal data folder also contains origin. This allows users to match each terminal data folder with a certain terminal installation directory, for example, in case when several copies of MetaTrader 4 terminal are installed by a user. This type of working with the terminal when the data folder is separated from the installation one is the main mode. For more convenience, an entry containing the path to the data folder is made in the terminal's journal each time the terminal is launched.
When the newly updated terminal is launched, it checks if the data folder is present. If the data folder is not present yet, then it is created. If that folder is different from the installation one, the terminal's regular data standard MQL4 programs, historical data, configuration files, templates, etc. The files that are not changed during the terminal operation executable files, mql. The terminal data folder is different from the installation one in the following cases:.
If none of the above conditions is satisfied, the terminal data is stored in the installation directory. Then, the user files are moved to the data folder. At this stage, the directory where the terminal's user data has been stored is determined.
If the data has been stored in the terminal installation folder, they are copied the following way:. Next, it is checked whether the client terminal has stored data in virtualization directory the operating system's virtual storage described above. If the terminal has been installed in Program Files directory and the operating system is Windows Vista or higher, the terminal data is most probably stored in that directory.
If the data is found, it is copied according to the above table. During the migration, the entries containing source and destination paths of the copied files are made in the terminal's journal. To view all the logs, open Journal tab of Terminal window and execute Open command in the context menu. The folder containing the terminal log files will open. If the migration has been completed successfully for the current terminal copy, it is not repeated any more during subsequent MetaTrader 4 terminal updates.
If the data folder is different from the installation one, and custom MQL4 applications have been copied together with the standard files during the migration, the following dialog window appears:. Portable launch mode is provided for the terminal operation on portable devices and non-system directories, as well as for working in Windows XP.
When launched in this 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 system is enabled. For more convenience, you can create an additional terminal launch shortcut with the appropriate name on your desktop and add the key directly to the shortcut:.
MQL4 is popular among automated system developers due to the ease of learning and a huge amount of code generated for many years of using MetaTrader 4 terminal. However, the language also has some drawbacks arising from its main advantage - a simple programming language does not allow development of complex systems and hinders porting of debugged libraries from high-level languages. Therefore, we decided to implement in it the maximum possible amount of MQL5 language functions and features fully preserving MQL4 functionality.
MQL5 Storage also becomes available for work. Besides, MQL4 now features new graphical objects and new functions for working with charts. MQL5 Standard Library is to be ported to MQL4 providing developers with new possibilities in creating their own graphical interfaces and trading libraries. Now, you can create full-fledged applications in MetaTrader 4 using the resources. It is recommended to find the cause and eliminate it.
There were no such files in the old MQL4. All custom executable EX4 files created by old MQL4 compiler will be automatically moved to the new Navigator directory and will work in the new terminal the same way as before.
When working in bit systems, separate installation directories are provided for 32 and bit programs: Program Files and Program Files x Operation features described in the article apply to both directories. The files are copied and not moved during the migration. The copied files are not deleted from the source folders. It is not recommended to use Portable mode in case you use Windows Vista or higher, and the terminal is installed in Program Files. This mode is provided for the terminal operation on portable devices and Windows XP.
If you have updated the terminal and all the data has been copied to a separate user data folder, it is also not recommended to switch to Portable mode. You should manually copy the data to the installation folder in order to use Portable mode after copying the data in the user data folder. Launching the terminal in Portable mode does not copy the data from the data folder to the installation one.
Conversion to the new format is required. See the previous news, please: Expert Advisors trading robots Note: No subdirectories are copied, since it is impossible to reliably determine their contents.
Libraries in the form of MQ4 source codes and EX4 executable files compiled from them. They are used for the dynamic call of the functions contained there by other MQL4 programs. MQL4 applications are allowed to execute file operations only within this directory.
Virtually any variable names except for the reserved words are possible, including special characters and points. Variable names cannot have special characters and points. The list of the reserved words has been expanded. Thus, such widespread words as short, long, const, etc. Variable scope is from declaration even in the nested block to the function end.
Variable scope is from declaration to the end of the block, in which the variable is declared. Implicit initialization of all the variables both global and local ones by zero. Only global variables are initialized. Only strings are initialized implicitly in local variables.
Ditto, except for the arrays of structures and classes, for which this error is critical one. Predefined Volume variable is of double type. Strings are unicode ones. Predefined Volume variable is of ulong type. ArrayCopyRates performs virtual copying to MqlRates array.
Copying to double array has remained intact for the sake of compatibility, however, that copying is real, not virtual. The functions may not return values even if they have a type. To do this, return 0 is automatically inserted by the compiler in the function end.More...