where is my MQL folder

 

Hi all,

I contracted a programmer to code an Ea that failed to work well because the EA was loaded in a folder that was not same location as the folder the developer loads the EA.His MQl4 folder is located under the FBS folder(as attached below) while mine is located under the open data folder of my mt4.I cannot find MQl4 folder under the c:\fbs folder but his own version of mt4 has it there.Please i need help on getting my MQL4 folder to be located at this folder also.I need help.  

 

Long time ago, somewhere like a year of half a year ago, all experts were stored in same folder where mt4 is installed. MT4 default program folder is c:/program files/metatrader4 or it can be changed to whatever user wants, like I:/fbs.com on your screenshot. All experts would be stored there in some sub-folder.

But, since one update - all experts were moved to different folder (c:/users/roaming/metaquotes/terminal/..../mql4/experts). Just click "open data folder" from mt4 menu to get there. This is new location, you cannot change it, and you should use it to store experts.

 

As far as I know - expert advisor cannot determine his folder, this is prohibited for security reasons. So, there is no way that its performance can be affected by folder location, your problem is probably something else.

 

But you can try to find really old mt4 installer, install it into "I:/fbs.com", ignore all updates, and then you will have old version, then copy expert to folder recommended by developer. But I doubt it will make ea better, its performance will be the same. 

 
Dr.Trader:

Long time ago, somewhere like a year of half a year ago, all experts were stored in same folder where mt4 is installed. MT4 default program folder is c:/program files/metatrader4 or it can be changed to whatever user wants, like I:/fbs.com on your screenshot. All experts would be stored there in some sub-folder.

But, since one update - all experts were moved to different folder (c:/users/roaming/metaquotes/terminal/..../mql4/experts). Just click "open data folder" from mt4 menu to get there. This is new location, you cannot change it, and you should use it to store experts.

 

As far as I know - expert advisor cannot determine his folder, this is prohibited for security reasons. So, there is no way that its performance can be affected by folder location, your problem is probably something else.

 

But you can try to find really old mt4 installer, install it into "I:/fbs.com", ignore all updates, and then you will have old version, then copy expert to folder recommended by developer. But I doubt it will make ea better, its performance will be the same. 

https://docs.mql4.com/constants/namedconstants/compilemacros


Check out __PATH__ 

Predefined Macro Substitutions - MQL4 Documentation
  • docs.mql4.com
Predefined Macro Substitutions - MQL4 Documentation
 

Oh wow, true, thank you for pointing that.

Description says "there are special macro constant, values of which are set at the moment of compilation" and "An absolute path to the file that is currently being compiled", but in reality its totally not a constant set during compilation; it indeed changes when expert is attached to chart according to current EA location.

Sorry, that was my mistake.

Nevertheless, I'd like to hear developer reason to do this folder lookup, and to know how it can affect trading results. As far as I know - even when you know folder location - there is no way for EA to read or write files in this folder, there are like only two specific folders that can be accessed (would be happy to hear that this is not true either :D )

 
Dr.Trader:

Oh wow, true, thank you for pointing that.

Description says "there are special macro constant, values of which are set at the moment of compilation" and "An absolute path to the file that is currently being compiled", but in reality its totally not a constant set during compilation; it indeed changes when expert is attached to chart according to current EA location.

Sorry, that was my mistake.

Nevertheless, I'd like to hear developer reason to do this folder lookup, and to know how it can affect trading results. As far as I know - even when you know folder location - there is no way for EA to read or write files in this folder, there are like only two specific folders that can be accessed (would be happy to hear that this is not true either :D )

Welcome :) And sorry if I sounded like a smart ass, I was in a hurry :)

Yeah I don't think that language is quite correct, should read more like "at time of initialization".

EDIT: Thinking about it some more, if you move the MQx file to a different directory, it gets re-compiled, so the description is technically correct

As far as I'm aware, there's technically 3 locations to write to (unless someone has more info???) but agree with what you're saying. I'm also not sure if you can change that using MKLINK (for virtual/symbolic folders) as I've never tried but maybe something worth looking at? 

 

There are three folders (with subfolders) that can contain working files:

- Terminal_folder\Experts\History\current broker\ - for history files;

- Terminal_folder\Experts\Files\ - for common usage;

- Terminal_folder\Tester\ Files\ - for files the are used for testing.

To the original poster, I suggest you get your programmer to re-code your EA. 

Cheers
 

"To the original poster, I suggest you get your programmer to re-code your EA. "

thanks for you suggestion but i really don't understand a think in all your other post except the last statement.

How do i explain to him to go about the re-coding of  the EA.do i ask him to code it to recognise my directory path or what do u think a developer can do about this

solving this problem.

i appreciate you inputs.

best regards

 

If you have not yet paid him, then ask him to fix the expert, because his job is obviously not properly done yet.

If his EA folder is located in program folder itself - it means that he is using old mt4 terminal version. You can ask him to download latest mt4 installer, install it and use for development. This way he will have EA created in same folder as yours (c:/users/roaming/metaquotes/terminal/..../mql4/experts), and he can fix all issues related to this location. This would be the best solution.

 

Dr.Trader,

you have said it all.your answer is the real answer to give to him.i will copy and paste your opinion to him since he is so convinced that the fault is from my end.

Thanks and best regards.

 

Tell your developer to read about TERMINAL_DATA_PATH in the documentation: https://docs.mql4.com/constants/environment_state/terminalstatus

There he will find usage example.

 

Also, he should read this article: https://www.mql5.com/en/articles/1388 

It describes new folders structure introduced in MT4 v600.  

Client Terminal Properties - MQL4 Documentation
  • docs.mql4.com
Client Terminal Properties - MQL4 Documentation
 
drazen64:

Tell your developer to read about TERMINAL_DATA_PATH in the documentation: https://docs.mql4.com/constants/environment_state/terminalstatus

There he will find usage example.

 

Also, he should read this article: https://www.mql5.com/en/articles/1388 

It describes new folders structure introduced in MT4 v600.  

drazen64,

thanks for the link and article.

regards