MetaTrader 4 Help
MetaTrader 4 HelpVirtual HostingMigration


Migration is transferring the current active environment from the client terminal to the virtual one. This is a simple and straightforward way to change the set of launched programs, open charts and subscription parameters in the virtual terminal.

Preparing for Migration

Before launching the virtual terminal, you should prepare an active environment for it charts, launched indicators and Expert Advisors, Signal copying parameters and the terminal settings.

Watch video: Preparing to Migrate Robots and Signals

Watch video: Preparing to Migrate Robots and Signals

How to setup a trading environment, in order to execute your trading robots and signals on a virtual platform for 24 hours a day?

Charts and Market Watch

In the Market Watch window, set up the list of symbols critical for your Expert Advisors' operation. We recommend that you remove all unnecessary symbols to decrease the tick traffic received by the terminal. There is no point in keeping hundreds of symbols in the Market Watch if only a couple of them are used for trading.

Open only the charts that you really need. Although there are no limitations on the number of open charts, there is no point in opening unnecessary ones. Color settings do not matter.

Set "Max bars in chart" parameter in Charts tab of the terminal settings. Some custom indicators are developed in a wasteful way and perform calculations on all history available on the chart. In that case, the lesser the specified value, the better. However, make sure that the indicator works correctly with these settings by restarting the terminal after changing this parameter.

The virtual terminal has been designed so that it automatically downloads all available history from a trade server, but not more than 500 000 bars are available on a chart.

Indicators and Expert Advisors

Apply to the charts all indicators and Expert Advisors that are necessary for the terminal's autonomous operation. Most trading robots do not refer to indicators on the charts, so check out and decide what you really need.

Products purchased on the Market and launched on the chart are also moved during migration. They remain completely functional, and the number of available activations is not decreased. Automatic licensing of purchased products without spending available activations is provided only for the virtual terminal.

  • DLL calls are completely forbidden in the virtual terminal. During the first attempt to call a function from DLL, the launched program is stopped with the critical error.
  • During platform synchronization with the virtual server, charts without Expert Advisors are ignored, even if custom indicators are running on these charts. If you need to migrate a custom indicator, run it on the chart of an "empty" Expert Advisor that does not perform operations. Such an Expert Advisor can be easily generated using the MQL5 Wizard in MetaEditor by selecting "Expert Advisor: template". This is to ensure that indicators are migrated on purpose.

All external parameters of indicators and Expert Advisors should be set correctly. Check them once again before launching synchronization.

Scripts cannot be moved during migration even if they have been launched in an endless loop on the chart at the time of synchronization.

Configuring Email, FTP and Signals

If an Expert Advisor is to send emails, upload data via FTP or copy Signal trades, make sure to specify all necessary settings. Set correct login and password of your account in Community tab. This is necessary for Signal copying.

Permission to Trade and Signal Copying

The automated trading is always allowed in the virtual terminal. Therefore, any Expert Advisor with trading functions launched during synchronization can trade on the virtual terminal after the migration. Do not launch the Expert Advisors you are not sure about.

When migrating Expert Advisors, autotrading function is automatically disabled in the local terminal. This is done is order to prevent the situation when two terminals connected with the same account trade with the same Expert Advisor.

Regardless of whether autotrading is allowed or forbidden in your client terminal or in the properties of a launched Expert Advisor, any trading robot is allowed to trade after being moved to the virtual terminal.

Set necessary trade copying parameters in Signals tab. If a trading account has an active subscription and trade copying is allowed, permission to copy signals is disabled in the client terminal during migration. This is done in order to prevent the situation when two terminals connected to the same account copy the same trades simultaneously. It is not necessary to turn on signal copying on the local terminal when migrating to a virtual terminal where the signal is already running.

The "Synchronize positions without confirmations" setting is always enabled in the virtual platform. The virtual platform has no user interface, the operations are copied only automatically, and it is impossible to confirm them manually.

Trade copying is automatically enabled on the virtual terminal when migration is complete. Message about copy cancelation in the client terminal is also repeated in the journal.

Setting WebRequest

If a program that is to operate in the virtual terminal uses WebRequest function for sending HTTP requests, you should set permission and list all trusted URLs in Expert Advisors tab.

Migration #

Migration is performed during each synchronization of the client terminal. Synchronization is always a one-direction process – the client terminal's environment is moved to the virtual terminal but never vice versa. The virtual terminal status can be monitored via requesting the terminal's and Expert Advisors' logs as well as virtual server's monitoring data.

To perform synchronization, open the context menu and select migration type. There are several types of migration that should be used depending on the objective:

  • All – complete migration is necessary if you want to simultaneously launch Expert Advisors/indicators and trade copying. In this mode, account connection data, as well as all open charts, signal copying parameters, launched Expert Advisors and indicators, FTP and email settings are moved to the virtual server.
  • Experts – only Expert Advisors and indicators are moved, if subscription to Signals is not required. Unlike the complete migration, signal subscription parameters are not transferred in this mode.
  • Signal – only Signal copying settings (no charts or programs) are moved. In this mode, account connection data, signal copying parameters, FTP and email settings are moved to the virtual server.

Starting migration

Thus, you always can change the number of charts and the list of symbols in the Data Window, the set of launched programs and their input parameters, the terminal settings and Signal subscription.

All available history concerning the open charts is automatically uploaded during the first synchronization. Uploading history from a trade server can take some time, and all programs launched on the charts should process the updated data correctly during the synchronization.

When performing migration, all data is recorded in the client terminal's log.

Logging migration process

After the synchronization, open the virtual terminal's main journal to examine the actions performed on it.

Requesting the Journal from the Virtual Terminal

In the newly opened log window, you can set a piece of text the journal entries are to be filtered by and a desired interval. After that, click Request to download the found logs.

Viewing Journal logs

The virtual terminal's logs are updated during each request and saved to [terminal data folder]\logs\hosting.*.terminal\.

Migration Features

The migration process has a number of features:

  • Automated trading is always allowed in the Virtual terminal even if it has been forbidden by the terminal settings or in the launched Expert Advisor's parameters.
  • Scripts are not moved during migration even if they have been launched in an endless loop on the chart at the time of synchronization.
  • Charts with non-standard timeframes and symbols are not moved.