[How To] properly run multiple MT4/5 instances

 

Hi guys,

I want to share with you how I managed to run multiple instances of MT4 in Windows 7 so that the History and Experts folders are the same in all of the instances. This way you only have to drop new indicators/experts into one folder and update history in one location. This is done so you can take an advantage of multiple cores/cpu that you may have on your PC. I have some heavy indicators running so I needed this.

What you need to do is copy the entire MT4 folder into another place without the history and experts folder in it. So for example if you have MT4 installed in:

"C:\Program Files (x86)\MetaTrader - Alpari (US)"

You make a copy of it into

"C:\Program Files (x86)\MetaTrader - Alpari (US) 2"

And you can repeat this as many times as you want.

Then in Windows 7, there is a command called Mklink that you can use to make a junction link. So open your windows command prompt and enter the command like the following to link up the history and experts folders. This is what I ran:

Mklink /j "c:\Program Files (x86)\MetaTrader - Alpari (US) 2\history" "c:\Program Files (x86)\MetaTrader - Alpari (US)\history"

Mklink /j "c:\Program Files (x86)\MetaTrader - Alpari (US) 2\experts" "c:\Program Files (x86)\MetaTrader - Alpari (US)\experts"

This will also save you on some disk space especially if you are running it on SSD.

Hope this helps someone

-Andre

 
saver0:
Hi guys,

I want to share with you how I managed to run multiple instances of MT4 in Windows 7 so that the History and Experts folders are the same in all of the instances. This way you only have to drop new indicators/experts into one folder and update history in one location. This is done so you can take an advantage of multiple cores/cpu that you may have on your PC. I have some heavy indicators running so I needed this.

What you need to do is copy the entire MT4 folder into another place without the history and experts folder in it. So for example if you have MT4 installed in:

"C:\Program Files (x86)\MetaTrader - Alpari (US)"

You make a copy of it into

"C:\Program Files (x86)\MetaTrader - Alpari (US) 2"

And you can repeat this as many times as you want.

Then in Windows 7, there is a command called Mklink that you can use to make a junction link. So open your windows command prompt and enter the command like the following to link up the history and experts folders. This is what I ran:

Mklink /j "c:\Program Files (x86)\MetaTrader - Alpari (US) 2\history" "c:\Program Files (x86)\MetaTrader - Alpari (US)\history"

Mklink /j "c:\Program Files (x86)\MetaTrader - Alpari (US) 2\experts" "c:\Program Files (x86)\MetaTrader - Alpari (US)\experts"

This will also save you on some disk space especially if you are running it on SSD.

Hope this helps someone

-Andre

Sounds awesome, Andre. I am running a dozen metatrader directories on three machines. Do you know if you can do it over a network as well? I assume you do the link on the machine that is running Terminal.

Mklink /j "c:\Program Files (x86)\MetaTrader - Alpari (US)\experts" "Z:\Program Files (x86)\MetaTrader - Alpari (US)\experts"

Neat way to make a really true multiprocessor system.

Tzuman

 

I haven't tried it Tzuman but it should work in theory

Also you can do the same for the templates folder.

 
saver0:
I haven't tried it Tzuman but it should work in theory Also you can do the same for the templates folder.

I was thinking about it also. I am somewhat concerned that Metatrader puts most of their system files in the various subdirectories of Experts. Files like mlqcache.dat in Indicators and the various ini and dat files in Profiles. I can see potential problems caused by one instance of terminal influencing a second instance. However, the use of MKLink seems to provide benefits that override these potential problems.

There is a Gui version Junction Link Magic

MKLINK – Create and Use Links in Windows - Windows 7 Help Forums

you may want to check it out, I am going to.

Tzuman