MetaTrader 4 Trading Terminal Build 670: Virtual Hosting, Web Requests and Working with Signals from MQL Applications

What's new in MetaTrader 4

4 July 2014

Trading terminal

  1. Preparatory works for Cloud Hosting implementation.

    Many traders want to arrange a reliable round-the-clock operation of the client terminal containing an active trading robot or following trading signals. One of the possible solutions is using VPS servers. However, finding a reliable provider, as well as diving into configuration and payment details require additional skills and time. Now, traders do not need VPS servers anymore.

    Virtual Hosting Cloud is a server network distributed all around the world and supporting special versions of MetaTrader client terminal. Selection of a suitable location, service plan, payment and synchronization is fully automated. A trader needs to complete only 5 steps in order to rent the virtual copy of a terminal with minimal network latency to the broker's trade server and select the most suitable service plan directly from MetaTrader 4.

    Virtual Hosting Wizard can be launched by selecting "Register a Virtual Server" command in the account context menu.

    The first dialog window briefly describes and illustrates the main points of the virtual hosting operation.

    After clicking Next, authorization window appears, where a trader should enter the account login and password or create a new account. If the existing login and password are already specified in the terminal settings, this step is skipped.

    At the next stage, environment is prepared for migration to a virtual copy.

    If you are sure that your terminal is ready for copying and you have read the rules, tick the "I agree to the 'Preparation of trading account for migration to virtual hosting' rules" option and click Next.

    The wizard automatically scans all the access points and provides you with the list of the most suitable servers.

    The following data is displayed in the table for each server:

    • Hoster - the name of a hosting company offering the server for rent.
    • Price, USD - rent payment in USD per month. If the server is used for a long time, the payment may be reduced, but discount is not displayed in this window.
    • Ping - a time interval between a request to the server and a response from it in milliseconds.

    After choosing the most suitable server, click Next. The next window contains available service plans.

    Select the most suitable service plan, tick the option "I agree to the virtual hosting service rules" and also the option "Automatically renew subscription with sufficient funds and terminal activity" if necessary. Click Next to go to the final step.

    Registration for virtual hosting rent has been completed.

    Now, the data migration mode and start time should be selected (data can be migrated right now or postponed). After making the final adjustments, click Finish.
    The additional context menu item for managing the server appears in Navigator window allowing traders to:

    • View the detailed information about the server.
    • Synchronize MetaTrader 4 terminal environment.
    • View MetaTrader 4 journal on the server.
    • Start/stop the server.
    • Terminate the server rent.

  2. Revised wizard of opening new account. Now, it is similar to the one in MetaTrader 5 terminal.

    The first stage of opening a new account is selection of a trading server for connection. This window allows traders to select a proposed server or add a new one.

    After selecting the server, click Next.

    Account type is selected in the next window. Here the details of an already existing trade account can be specified or a new one can be created.

    Click Next. When creating a new account, the next step is specifying personal details.

    Fill in all the mandatory fields, tick the option "I agree to subscribe to your newsletters" and click Next.

    The newly created account is registered on the specified server. After that, its details are displayed.

    After clicking Finish, the newly created account is automatically connected to the trade server. It also appears in the Accounts section of the Navigator window. If Cancel is clicked in this window, connection to the trade server is not performed and the account is not added to the Navigator window, though it is already created. You can connect to the server later using the account details.

  3. Revised the Navigator's context menu.

    • Login has been renamed to "Login to Trade Account" and added to the context menus of the "Accounts" and "<Server name>" sections.
    • You can log in to not only via the terminal settings but also via the context menus of the "Accounts" section and its subsections.
    • The following changes have been implemented to the account's context menu:
      • Moved "Open an Account" command to the first position.
      • Added "Change Password" feature.
      • Added "Register a Virtual Server" command.
    • The list of compiled programs and the programs themselves can be refreshed now directly from the context menu using the "Refresh" command. Terminal restart is not required.

  4. In the "Navigator" categories "Indicators" and "Custom Indicators" have been combined into one category "Indicators".

    All custom indicators, examples, and indicators purchased from the MetaTrader AppStore are now shown together with the built-in technical indicators. Technical indicators are now divided into four categories: Trend Indicators, Oscillators, Volume Indicators, and Bill Williams' Indicators. Built-in indicators are always displayed first.

  5. Added display of the current market for a trading symbol as the depth of market having the ability of quick and easy order management. The new tool allows placing, modifying and deleting orders quickly and with maximum clarity providing the best trading opportunities.

    The best depth of market prices are the current Bid and Ask for the symbol. The next level is set as the closest level allowing placing Buy Limit and Sell Limit orders considering stop level for the symbol. Further levels are set according to the symbol's price step.

    Trade column contains buttons for one-click placing of pending orders. The order is placed at the price with a pressed button.

    • At a click on the blue arrow button in the area of Bid prices, a Buy Limit order is placed at the specified price. The same action in the area of Ask prices places a Buy Stop order.
    • At a click on the red arrow button in the area of Ask prices, a Sell Limit order is placed at the specified price. The same action in the area of Bid prices places a Sell Stop order.

    Pending orders, as well as stop loss and take profit levels of positions can be quickly modified by a simple drag-and-drop. If a limit order is dragged through Ask/Bid border, it will change to a stop order (Buy Limit is replaced by Buy Stop, while Sell Limit - by Sell Stop). The same rule applies when dragging Stop orders.

    To quickly remove a level, hover the cursor over its line, hold down Shift key and click the cross button.

    Using Buy and Sell buttons at the bottom of the depth of market, you can quickly place market orders with predetermined stop loss and take profit levels.

  6. Fixed font display in the terminal search bar when working via remote desktop session.
  7. Changed location of chart windows in Tile Windows mode.

    Tile Windows is the most widely used method allowing users to efficiently arrange several open charts for working with them. In this mode, the windows are displayed next to each other allowing you to monitor price changes on multiple charts. The following changes have been implemented to this function:

    • "Tile Windows" command is now available as a button on the "Charts" toolbar.
    • This command has also been moved to the first place in the "Window" menu.
    • "Tile Windows" command now also has its keyboard shortcut Alt+R.

  8. Fixed checking permission to trade when moving trading levels on a chart using drag-and-drop.
  9. Added ability to close a chart window by clicking middle mouse button on its tab.
  10. Fixed applying templates to charts. In some cases, indicator parameters from template were set incorrectly.
  11. Fixed display of the Label and Bitmap Label graphical objects with the anchor point located in one of the bottom corners of a chart.
  12. Fixed balance graph generation in the report based on trading history.
  13. Fixed saving a template in case it is named in Japanese or any other hieroglyphic language.
  14. Added logging of stop loss, take profit and pending order triggering in the terminal journal. Entries are added in the journal only for the active trading account, and only if the terminal is connected at the time of activation.

MQL4 Language

  1. Added WebRequest function for working with HTTP requests allowing MQL4 programs to interact with different websites and web services.

    The new function allows any EA to exchange data with third-party websites, perform trades based on the latest news and economic calendar entries, implement analytics, generate and publish automatic reports, read the latest quotes and do many other things that could previously be achieved only by using third-party DLLs of questionable reliability. The new feature is absolutely safe for traders, as they are able to manage the list of trusted websites the programs have access to.

    WebRequest() function sends and receives data from websites using GET and POST requests. To allow a MQL4-program to implement such requests, the "Enable WebRequest for the following URL" option must be enabled in the terminal settings and URL-addresses of trusted sites must be manually explicitly specified.

    This option is disabled by default for security reasons.

  2. Added access to signals database and managing signals subscription from MQL4 applications.

    Now, a user can receive the list of signals, evaluate them according to specific criteria, select the best one and subscribe to it automatically from an MQL4 program. In fact, it means the advent of the new class of trading robots that scan available signals and subscribe to the one that is most suitable at the moment.

    To provide this, the new families of functions have been added to MQL4 language:

    • SignalBase*() — functions for accessing the signals database.
    • SignalInfo*() — functions for receiving signal settings.
    • SignalSubscribe() and SignalUnsubscribe() — subscription management functions.

    Thus, a user can not only copy trades, but also to select signals for copying. Both processes are automated.
    By default, a trading robot is not allowed to change signal settings for security reasons. To enable this function, tick the "Allow modification of Signals settings" option in Expert Advisor settings.

  3. Fixed display of OBJ_LABEL and OBJ_TEXT graphical objects when changing their texts from an MQL4 program.
  4. Adjusted the values of MQL4 application deinitialization reason macro definitions. Now, they are fully consistent with the corresponding values in MQL5.
  5. Fixed errors when changing dimensions of an MQL4 program settings dialog.
  6. Fixed an error in StringConcatenate function.
  7. Added definition of the custom indicators that are executed too slowly. If the indicator is slow, "indicator is too slow" entry appears in the Journal.
  8. Fixed FileSize function for files that are available for writing. Previously, the function returned the file size without considering the latest write operations.
  9. Added new properties of the client terminal that are available through the TerminalInfo* functions:
    • TERMINAL_MQID - the property shows that MetaQuotes ID is specified in terminal settings.
    • TERMINAL_COMMUNITY_ACCOUNT - this property shows that account is specified in the settings.
    • TERMINAL_COMMUNITY_ACCOUNT - this property shows that account is specified in the settings.
    • TERMINAL_COMMUNITY_BALANCE - value of balance on the account.
    • TERMINAL_NOTIFICATIONS_ENABLED - shows whether sending notifications through MetaQuotes ID is allowed.

Trading signals

  1. Added display of a signal description considering an interface language.
  2. Fixed operation of signals in case of memory shortage when copying a signal.


  1. Added ability to debug the template functions.
  2. Optimized work with large source text files (tens of megabytes). Operation speed has been increased, while memory consumption has been reduced.
  3. Fixed navigating through a source code using "Ctrl + -" and "Ctrl + Shift + -" shortcuts.

Fixed errors reported on the forum and in crash logs.

The update is available through the LiveUpdate system.