Русский 中文 Español Deutsch 日本語 Português 한국어 Français Italiano Türkçe
How to Prepare a Trading Account for Migration to Virtual Hosting

How to Prepare a Trading Account for Migration to Virtual Hosting

MetaTrader 5Examples | 1 October 2014, 11:03
204 405 167

MetaTrader client terminal is perfect for automating trading strategies. It has all tools necessary for trading robot developers powerful C++ based MQL4/MQL5 programming language, convenient MetaEditor development environment and multi-threaded strategy tester that supports distributed computing in MQL5 Cloud Network. In this article, you will find out how to move your client terminal to the virtual environment with all custom elements. 

How to Provide the Reliable Round-the-Clock Operation of the Terminal?

A trader may need a terminal running 24 hours a day in the following three cases:

All these cases require constant connection to a trade server and uninterrupted power supply. Using a home PC is not always possible and convenient. Until recently, the most popular solution has been renting allocated computing capacities as VDS or VPS from specialized companies.

MetaTrader platform offers much more convenient and quick solution ‒ you can rent a virtual server for your trading account right from the client terminal.

What Is a Virtual Terminal

Virtual terminal has been developed specifically for working in Virtual Hosting Cloud network offering rental services. Any trader may rent a ready-made virtual server with already arranged trading environment in a few mouse clicks right from the client terminal.

Allocating a Virtual Server

To receive a virtual terminal, select the appropriate trading account and execute "Register a Virtual Server" command in the context menu.

Virtual Hosting Wizard window appears. It shows how the virtual hosting network works. The process of obtaining a virtual server consists of three steps. First, you will find out how to prepare for migration. After that, you will select the nearest virtual server with minimal network latency to your broker's trade server.

You can choose 1440 free minutes provided to each registered user or select one of the offered service plans. Finally, you will select the data migration mode depending on your objectives:

  • complete migration is necessary if you want to simultaneously launch Expert Advisors/indicators and trade copying;
  • only Expert Advisors and indicators if subscription to signals is not required;
  • only trade copying - only Signal copying settings (no charts or programs) are moved.

There are no limitations on the number of charts and Expert Advisors/indicators. The number of activations for products purchased in the Market is not decreased when launching them on a virtual terminal.

After selecting the migration mode, you can launch the virtual server immediately by clicking "Migrate now" or do that later at any time.

Congratulations! Now, you have your own virtual server with MetaTrader terminal ready for work!

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.

Charts and Market Watch

In the Market Watch, 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.

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.

Virtual terminal can be automatically restarted when it is updated through the LiveUpdate, as well as during the maintenance of virtual hosting. Thus, all the programs intended to operate on the virtual platform must correctly process terminal stop and restart in order to correctly continue their operation after these events.

Terminal global variables are not migrated to the virtual hosting. If you need to initialize lots of variables when starting a program, you can use reading from files that can be passed using the "#property tester_file" directive.

Sending Files

If a certain file is required for an Expert Advisor or indicator, you can send it to the virtual terminal by specifying a #property parameter:

  • #property tester_file "data_file_name"- for sending a file from <data_folder>\MQL5\Files or <data_folder>\MQL4\Files
  • #property tester_indicator "indicator_name" - for sending a custom indicator from <data_folder>\MQL5\Indicators or <data_folder>\MQL4\Indicators
  • #property tester_library - "library_name" - for sending a library from <data_folder>\MQL5\Libraries or <data_folder>\MQL4\Libraries

Please note that called libraries are identified and sent to the hosting automatically during the migration even if they are not specified. Therefore, you do not need to specify them. Also, you do not need to specify indicators that are explicitly called in the code by their names via the iCustom() function.

When migrating, these directives are identified by the terminal and the necessary files are sent. The file size should not exceed 64 MB.

Sample code for sending files of the following three types to the virtual terminal:

    #property tester_file "trade_patterns.csv"    // A data file an Expert Advisor is to work with. It should be specified if needed on the hosting
    #property tester_indicator "smoothed_ma.ex5"  // Custom indicator file if the indicator name can be identified
    #property tester_library - "alglib.ex5"       // Library of the functions called in an Expert Advisor. You do not need to specify it

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.

It is highly recommended that you specify your MetaQuotes ID and allow sending messages of performed trades in Notifications tab. Thus, you will stay aware of what is going on at your trading account without even opening your terminal.

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.

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.

Trade copying is automatically enabled on the virtual terminal when migration is complete. Message about copy cancellation 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 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.

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, execute "Synchronize Environment" command and select migration type.

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.

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

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

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.

Virtual terminal logs themselves are updated at each request and saved in <terminal data folder>/logs/hosting.<hosting_ID>.terminal and <terminal data folder>/logs/hosting.<hosting_ID>.experts.

Working with the Virtual Terminal

The rented virtual server status can also be easily monitored from the client terminal. Execute "Details" command in the context menu.

The newly opened dialog window shows the virtual server's monitoring data:

  • CPU usage graph, %;
  • memory usage graph, Mb;
  • hard disk usage graph, Mb.

The main tab contains data on the virtual server itself and the terminal's active environment:

  1. server name and rent number;
  2. rent start date, account and trading account status;
  3. used service plan and remaining rental time;
  4. status  - started or stopped.

Besides, the following data is displayed for the virtual terminal:

  • last migration date and mode;
  • data on Signal subscription's migration and disabling trade copying on the client terminal (if an active subscription is present);
  • number of opened charts, Expert Advisors/indicators launched on it, moved EX4/EX5 libraries and created files.

The context menu of the rented server's icon is also used to launch and stop the virtual terminal. The rent can also be canceled there. No refund is provided in case of an early cancellation.

Virtual Hosting Is the Best Solution for the Automated Trading!

The benefits of the virtual hosting service are evident:

  • fast and easy way to receive a virtual server directly from the client terminal;
  • ability to examine and test the service within free 1440 minutes that can be used in parts;
  • ready-made and configured virtual terminal;
  • flexible service plans with discounts depending on a rental period duration;
  • ability to select location with the minimum network latency to your broker's trade server;
  • you can easily pay rental fees using your unified account. Ability to pay from a trading account is underway.

What do traders need to be able to perform the automated trading round-the-clock or copy trading signals? They need transparent and intuitive service that ensures reliable terminal operation with a guaranteed connection to a trade server and requires minimum efforts from a user.

Virtual hosting solves these issues - simply choose a virtual server and use your free 1440 minutes to check it out!

See also:

Translated from Russian by MetaQuotes Ltd.
Original article:

Last comments | Go to discussion (167)
Vinicius de Oliveira
Vinicius de Oliveira | 30 Aug 2022 at 12:53
HafizulRos #:

I'm currently using a vps service from you rn. I wanna ask how to withdraw money from the vps account to my broker account on mt4, before the expiration of my subscription.

 Withdraw from MQL5 account:

Michael_2000 | 13 Oct 2022 at 17:31

Hello guys,

I opted yesterday for a free VPS of 24 hours. I migrated all my stuff and it turned out to work good. But, as soon as I closed the laptop, the VPS stopped and not working anymore. I checked all the details again but nothing wrong found. Can you verify please what is going on ?

Juvenille Emperor Limited
Eleni Anna Branou | 10 Nov 2022 at 11:37
Michael_2000 #:

Hello guys,

I opted yesterday for a free VPS of 24 hours. I migrated all my stuff and it turned out to work good. But, as soon as I closed the laptop, the VPS stopped and not working anymore. I checked all the details again but nothing wrong found. Can you verify please what is going on ?

Have you checked the MQL5 VPS (right click) >> Journals, to see that you have the successful synchronization message?

Rifaint957 Arif
Rifaint957 Arif | 26 Dec 2022 at 14:32
Hello all,

Is ther possibility have to withdraw money from MT5 account without broker ?? 
My broker was scammer as below name CTRL investment’s Limited server name is Filecoinfx foundation. If anyone please know the way to withdraw money from MT5 account without Bronson please let me know.! Really appreciate 
Fernando Carreiro
Fernando Carreiro | 26 Dec 2022 at 14:43
Rifaint957 Arif #: Hello all, Is ther possibility have to withdraw money from MT5 account without broker ?? My broker was scammer as below name CTRL investment’s Limited server name is Filecoinfx foundation. If anyone please know the way to withdraw money from MT5 account without Bronson please let me know.! Really appreciate 

No! All funding and withdrawals to real trading accounts are via your broker (Tips to avoid being scammed …).

If your broker was a scammed then you have lost your money. Only the police or some government agency may be able to help you but the chances are low.

MQL5 Cookbook: Processing of the TradeTransaction Event MQL5 Cookbook: Processing of the TradeTransaction Event
This article considers capabilities of the MQL5 language from the point of view of the event-driven programming. The greatest advantage of this approach is that the program can receive information about phased implementation of a trade operation. The article also contains an example of receiving and processing information about ongoing trade operation using the TradeTransaction event handler. In my opinion, such an approach can be used for copying deals from one terminal to another.
Regression Analysis of the Influence of Macroeconomic Data on Currency Prices Fluctuation Regression Analysis of the Influence of Macroeconomic Data on Currency Prices Fluctuation
This article considers the application of multiple regression analysis to macroeconomic statistics. It also gives an insight into the evaluation of the statistics impact on the currency exchange rate fluctuation based on the example of the currency pair EURUSD. Such evaluation allows automating the fundamental analysis which becomes available to even novice traders.
MQL5 Cookbook: Handling Typical Chart Events MQL5 Cookbook: Handling Typical Chart Events
This article considers typical chart events and includes examples of their processing. We will focus on mouse events, keystrokes, creation/modification/removal of a graphical object, mouse click on a chart and on a graphical object, moving a graphical object with a mouse, finish editing of text in a text field, as well as on chart modification events. A sample of an MQL5 program is provided for each type of event considered.
Indicator for Constructing a Three Line Break Chart Indicator for Constructing a Three Line Break Chart
This article is dedicated to the Three Line Break chart, suggested by Steve Nison in his book "Beyond Candlesticks". The greatest advantage of this chart is that it allows filtering minor fluctuations of a price in relation to the previous movement. We are going to discuss the principle of the chart construction, the code of the indicator and some examples of trading strategies based on it.