Saturday, July 2, 2011

Meta-Trader - Moving Platforms / Disaster Recovery

Welcome back Meta-Traders.

As you know I've had some platform issues this past week. As of now, I have successfully migrated to another laptop computer, so its a good time to recap what I have learned in the process. Most of the process is pretty straightforward, but I haven't seen anyone else cover these topics, so I figured I would do so here.

Even if you are not planning to migrate platforms, its important that you make a backup of your Meta-Trader data so that if you have a system crash, you won't need to re-create your Meta-Trader setup from scratch.

First, Meta-Trader 4 stores all its information under C:\Program Files\FolderName where you get to pick FolderName during MT4 installation. This includes not only the program files themselves, but the expert adviser files, settings, downloaded data etc. In other words, the program files themselves are intermingled with user data.

Most modern Windows programs store their user-specific data in the registry, or in user-specific folder locations such as %userprofile% or %appdata%. These represent environment variables. To see where they point to through Windows Explorer, click Start, and simply type in the variable name surrounded by % such as %userprofile%. You can also see the active environment variables by going to the Windows command prompt (Start, run CMD) and type SET.

Why is this important and why do we care?

We care because Microsoft realized that programs that store user data under c:\Program Files can cause system instability. To respond, they created a new feature starting with Windows Vista called Data Redirection. This feature is also present in Windows 7. This feature is not present in Windows XP, so if you are running Windows XP, this does not apply. The bottom line, is that if program is running in "user context", output to Program Files is re-written as follows:

PlatformOriginal LocationRedirected Location
Windows XPC:\Program FilesC:\Program Files
Windows Vista/7C:\Program Files%appdata%\Local\VirtualStore\Program Files

Using Windows explorer, find the location of your actual Meta-Trader files. Once you have confirmed the actual location of your Meta-Trader data, make a backup as follows:

- Create a folder on your network drive or USB memory stick with the same name as the FolderName you installed Meta-Trader to on the source computer

- Copy the Meta-Trader data folders to the new FolderName on your backup location

As to what folders to copy, here they are along with a brief description of the contents:

FolderDescription
ExpertsExpert Advisor files and associated data which is stored in sub-folders such as Data and Presets.
ConfigAccount and server information.
ProfilesOpen charts and settings for your Meta-Trader layout.
TemplatesInformation displaying what is required to gather addition user input for adding indicators. Normally, this folder doesn't get written to, but the statement.htm file needs to be updated for certain Meta-Trader vendors to get data to appear properly when using MyFxBook. If you haven't had this problem, and don't know what i'm talking about, you can skip this folder.

Once you have a backup of your data, install Meta-Trader for the provided Forex Broker on your new target computer. To keep things simple, use the same folder name you used on your source computer. To keep from having to type in the name, right-click on the folder name and click Rename. Now press CTRL-C to copy the folder name to your Windows clipboard. When Meta-Trader prompts for Folder Name during installation, press CTRL-V to paste in the folder name.

It also goes without saying that you need to keep a copy of the installer EXE for your broker-specific installation of Meta-Trader around. Sure you can always re-download it from the broker web-site, but its one less thing to hunt around for when you are in a panic after a system crash.

Once you have completed an installation of Meta-Trader, un-check the option to run Meta-Trader automatically after installation and close the installer.

Next, simply copy the 4 folders above from your backup location to the new Meta-Trader folder on your target computer. Its easy to get confused when copying files. I like to arrange the Windows such that the source folders are on the right and the target folders are on the left. Then its simply a matter of dragging and dropping the folders from right to left.

Once file copy is complete, go ahead and launch Meta-Trader on your target computer. When prompted, entered the password for your Meta-Trader account. That is one piece of data which is not transferred in the process and that you must record manually. You also may be required to enter the server where your Meta-Trader points to if one of the pre-supplied values were not used.

Once you enter the password, accept any prompts to update Meta-Trader. Once all that is done, voila! Your expert advisor is now running on your new target computer. Even the publisher data for MyFxbook is migrated in the process.

Once you are up and running on the new computer, remember to close Meta-Trader on your source computer because you don't want to run 2 instances of Meta-Trader pointed to the same account, or trades could be duplicated.

One final thing (if you haven't done so already) create a MS-Word or other document containing a table with one row for each account:

Account name - Short name for the account
Account number - Provided by your Forex Broker
Account password - Provided by your Forex Broker or your choose during account setup
Server - Server name or IP Address used for your account instance - also provided at account setup time.

Also, separately on the page, include the customer service number for each of the brokers that you use. Now print out the page and keep it in an important place. Should you have a complete power outage for an extended period, it may be required to call the broker to manually close any open trades. Normally, this would not be necessary since each order should have a standing TP and SL, but you never know.

Its important to take these simple precautions ahead of time so that you are prepared in the event of a disaster. If you loose power, and you have to start scrambling to find this information, you could loose valuable time, and you will have no one to blame but yourself for lack of preparation.

Even if you are not planning to migrate platforms, go ahead and make a backup of your Meta-Trader data for safekeeping. That way you will be prepared for disaster when it strikes.

No comments:

Post a Comment