Examples: Data Structure in MetaTrader 4 Build 600 and Higher

 

New article Data Structure in MetaTrader 4 Build 600 and Higher has been published:

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.

Author: MetaQuotes Software Corp.

 
two weeks and hundreds of questions later, here it is.
 

Is it correct behaviour for MT4 to stop using the new data folder and begin using the installation folder for data storage if UAC is subsequently disabled?

 

I have new version 610, but i can not use library and include any more. always show me can not find the file when i try to compile a script.

the problem is that compile always look script folder for library.

How can i fix it? theanks screen snapshot

 
It doesn't matter, but the following is incorrect: "A unique name consists of 16 characters". The unique name is an MD5 hash which is 16 bytes long, but represented as 32 hexadecimal characters.
 
why i can not copy directly now i can not see in c directory folder for custom indicator
 

Really i didnt understand anything from up there ..it is like a Chinese for me.I just need a simple way of coping some files into indicators folder, templates and experts ...how can I do it and see it in the software and cancel this stupid thing called administrator ....nobody else is using my PC

Please Help

 

The data storage solution is a problem for users that have several platforms installed on other partitions from their system drive. Lets say you have 4-5 platforms from different brokers. You test on some and you trade on some.

The folder size of these platforms might be around 1-3GB if you have historic data for testing, it might even be more. This patch then copies several gigs of these history files into the users profile. My own got 8 GB larger!

Coming from a system administrators perspective, it is bad practice to install that much into a user profile. Coming from a coders perspective I can see how it might be convenient, but it is NOT a good or clean solution.

 

The way this patch has been solved just seems very sloppy and not thought through. 

You should really be able to let users move all those files out from the users profile and solve it with a config file of some sort that points to the correct location instead, especially with the files and history folders.

 
This messed up everything!! I cannot even transfer custom indicators from one platform to another. I putt ALL MT4 folders to the impossible-to-remember-obscure-no-one-cam-find path C:\Users\<user-name>\AppData\.... and none of my indicatord are showing up!!  Time to start learning a new programming language and finally trash the MT/MQL! This platform is just regressing and the mt5 "upgrade!" was living proof that they are so out of touch that no reason to stay on board!
 
This was a really bad decision because it doesn't take into account the fact that you can install metatrader somewhere other than in a program files directory, but when you do your files go into your c: drive under this unreadable appdata directory.  If you need to reinstall windows, or you redo your c: drive with an image, it'll get blasted over in the users directory and you're screwed. I keep my MQ4 files on a separate drive just for this reason.  The Metaquotes authors should fix this immediately! If your installallation is not in Program Files or Program Files (x86) there is no need to comply with Microsoft and it should save everything in your MQ4 directory structure!
 

From a system administrator view, 8gb used to be a lot in a user profile. In perspective of the smaller but faster solid state disks, its still a lot. For instance a 8 GB user profile with a 80 GB system partition, results in a 10% of disk usage.  The data processing design of MQL4 and 5 seems to take place in the two C:\users\username\appdata\roaming\Metaquotes\ and  C:\Users\username\AppData\Roaming\MetaTrader (Broker specific name) folders

Because the virtual private service, probably uses terminal server technology, the roaming user data folder is by Microsoft design, the best place to synchronise Expert advisors, charts and indicators, to a microsoft user profile on a virtual terminal server.

A design solution could be a postgress SQL database where for instance history data is stored and accessed through a form of dlll authorisation per user. Although the history centre is gone in MQL 5. Therefore i decided to use MS excel to backtest algorhytms on historic price data. All log processing takes place in the user profile. Is a maximum log folder size applicable?

Another point of view is, to keep all standard EAs, Indicators and scripts in the C:\Program files\Metatrader 5\MQL5 directory. This only works when writing paths in the "C:\users\username\appdata\roaming\Metaquotes\terminal specific to user" are authenticated correctly. E.g. custom Expert advisors should be permitted to write and read, correctly,consistently, timely and valid.

 I am not sure if the cause is Microsoft design standards or a lack of man power, budget, or priorities at the Metaquotes team. In my opinion the solution lies in application authentication and authorisation, if applicable at all. For users with no IT knowledge copying and moving indicators or EAs seems cumbersome.

Reason: