Data Folder Location (TERMINAL_DATA_PATH)

 

I want to be able to write and installer that places indicators, EA's, scripts in the right location.  

The obvious problem is automatically finding the correct folder in the users profile.  Most users won't know which is the correct folder and its not very intuitive.

Ideally I would like the user to select the location of the metatrader terminal folder and I work out the rest.   

I  see from setting up multiple copies of the terminal that the folder name in the users profile is some sort of computed value based on the path of the executing terminal.

So my question is, can the algorithm that names the folder in the users profile be made public? 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Environment State / Client Terminal Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Environment State / Client Terminal Properties - Documentation on MQL5
 

Looking at this a little further it just looks like the folder name in the users profile is a hash of the path to the terminal.  

 My guess is that when the terminal starts it creates a hash of the folder it started up from, then checks appdata\roaming\MetaQuotes\Terminal for a folder with the name of the hash.  If it doesn't exist it creates a new folder structure.

I don't think my logic could be to far off, question is what hash algo is being used.  I have tried the obvious ones like MD5 but it doesnt match.

So what hash is being used? 

 

Can someone from MetaQuotes please tell me how I can automatically (programmatically) determine the location of the terminal_data_path.  Not from within Metatrader but from an installer.

 

Thanks 

 

Never mind I have worked it out :)

 

 

 
pfx:

Never mind I have worked it out :)

 

 i have some problem, what did you do ?

 
I have the same problem, I'd be very happy to know what the solution could be.
 
Documentation on MQL5: Standard Library / Trade Classes / CTerminalInfo / CommonDataPath
Documentation on MQL5: Standard Library / Trade Classes / CTerminalInfo / CommonDataPath
  • www.mql5.com
CommonDataPath - CTerminalInfo - Trade Classes - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: