Consolidating and organizing indicators / EAs / etc

 
A suggestion, and some questions:

I believe you have to have multiple MT4 installations to connect to multiple accounts (e.g. a live account and a demo account at the same time) or multiple brokers.

I thought it was insane to try to keep sets of indicators &etc current in N different MT4 installs, so I consolidated. I have one CommonExperts directory that contains the normal contents of the "experts" directory in a normal MT4 install. Then in each of my N MT4 installs, I delete the "experts" directory and replace it with a link (see https://en.wikipedia.org/wiki/NTFS_symbolic_link) called "experts" which points to CommonExperts. Now all the MT4s share the common set of indys/etc. You need only maintain one copy of everything, for all MT4s. Seems to work great. I think.

Next step: trying to add some degree of organization to all the indicators / etc in there. MT4 wants to dump all the indicators into the indicators folder, all the EAs in the experts folder, etc. That gets completely unmanageable when you're experimenting with dozens of different indicators, systems, EAs, etc. All the indicators are piled into one directory and you have no idea what goes with what, what system/EA/approach those indicators belong to, and so on.

No problem, I thought -- I'll just organize them into sub-directories. So I can create indicators\Stuff, indicators\MoreStuff, indicators\StillMoreStuff, etc. That keeps those separate groups of indicators separate so I can remember what goes with what. I even created an indicators\MT4stuff for all the standard MT4 indicators that I never use, so they don't clutter up the custom indicator list.

Except MT4 doesn't seem to have any way to USE things in sub-directories. Insert -> Indicators -> Custom shows the indys in the "indicators" folder, but it does NOT let you browse into sub-directories. Same with the "Custom Indicators" section of the Navigator.

Is there any way to insert indicators/etc from sub-directories?

I had partial success with a template file from a friend. I edited the "name=IndicatorName" lines in the *.tpl file to say "name=JOE\IndicatorName", and MT4 happily loaded the indicators from the indicators\JOE directory. Or at least some of them -- only the ones that were pre-compiled to ex4 worked. I had to hand-compile the mq4 files in the editor for the template to load the indicators.

And in fact only ex4 files work in the "indicators" folder too. Usually MT4 automatically compiles mq4 files to ex4, so you see them in the indicator list -- but that doesn't seem to be working now.

I wonder if my CommonExperts trick has thrown that off somehow?? I tried using mklink to create symbolic links and junctions (another type of link) but still had the problem. I tried to create a hard link, but that seems to only be supported for linking to files, not to directories.

Any suggestions?

Thanks!
Gary

 

I feel your pain.

I have 6 installs on my system and 4 virtual PCs - yes, it gets a little confusing. Here is what I am doing (mostly as an experiment) and if it helps great. Let me know how it works for you.

Let's skip the VPCs for now. One install is development, 4 are forward testing and 1 is production. The directories are like this:

c:\mq4-dev - this is development

c:\mq4-fwd1

c:\mq4-fwd2

c:\mql4-fwd3

c:\mql4-fwd4

c:\mql4-prd1

So, in the experts directory of the development install, create a symbolic link to each of the four forward testing installs connecting the level above the experts directory.

mklink /d fwd1 c:\mql4-fwd1

mklink /d fwd2 c:\mql4-fwd2

mklink /d fwd3 c:\mql4-fwd3

mklink /d fwd4 c:\mql4-fwd4

So, now open the MetaEditor in the dev install and you will see the four forward testing directorys in the files pane on the right.

Any time you go into any of the fwdx directorys and compile the source the executable will go into the correct directory and the Navigator in fwd1 should be able to see the executable. This is a bit flakey such that the Navagator does not always become aware of *NEW* files some times without restarting the terminal (boo!).

You should always only ever compile from the dev install, and only move code one way: dev -> fwdx -> prod.

Regarding production, *DELETE* the compiler in that install! Don't connect that install to anything (actually, I have production on a separate PC across the room so I do no make one of those "ooohhhh darn" momements). When ever you promote and executable to production, copy the source to the correct directories there so you have a back up and a reference to what is running.

For what it's worth I got a precomplier for MQL4 working so you could do statements like:

int __TraceLevel = 0;

#define TRACEEnter  Print("Entering ",__LINE__," ",++__TraceLevel," ",\
                    "of ",__FILE__);

#define TRACEExit   Print("Exiting  ",__LINE__," ",__TraceLevel--," ",\
                    "of ",__FILE__);
                    
                    
start()
{
TRACEEnter


TRACEExit
}

It is really in the "string, glue, bubble gum and tape" stage. But if anyone wants more info on how it works, I'll put it up here.
 

Hm. Your approach doesn't help the "500 indicators in one folder" problem -- MT4 is still oblivious of sub-folders, and I assume your development system will still have everything in one folder. (Or maybe you have sub-folders for development, then manually copy the ex4 files where you need them?) I guess it gets around the "MT4 doesn't compile mq4 files for some reason" problem because you manually compile everything in your development install. It mostly gets around the "maintaining objects it too many places" problem because you only work with indicators/EAs/scripts in the dev install, then copy them to the test/production target.

Your solution has some advantages over mine, but I think I prefer the "all installs are identical" model. I may change my mind after working with it for a while. I think it would work fabulously if MT4 was smart enough to recognize sub-folders. *sigh*

Thanks for the ideas!

 
by the way, mt5 is a lot better at this... you can have subfolders
 
That will be good some day. But everything I hear says that mt5 is not ready for prime time yet.