What's new in MetaTrader 5

The history of updates of the desktop, mobile and web platforms

19 May 2016

MetaTrader 5 iOS build 1335

It is now much easier to transfer SSL certificates from the desktop platform to the mobile one. You no longer need iTunes to do that.

MetaTrader 5 allows you to add an extra protection to your account by using a certificate. Without the certificate, connection is impossible. If the certificate was created in the desktop version, you should transfer it to be able to enter your account via a mobile device.

To do this, open a desktop platform, right-click the necessary account in the Navigator window, and select Transfer. Set the certificate password which is known only to you, open the mobile platform, and connect to your account. You will be immediately offered to import the certificate.

Besides, the latest version features the migration dialog for accounts transferred from MetaTrader 4. If your account has been transferred to the 5th generation platform, you are warmly greeted, provided with information on the new features, and offered to change your password.

13 May 2016

MetaTrader 5 Platform build 1340: Convenient transfer of certificates to mobile devices and Strategy Tester improvements

Terminal

  1. Now certificates used for the advanced security connection can be conveniently transfered from the desktop platform to mobile terminals.

    The trading platform supports extended authentication by protecting a trade account using an SSL certificate in addition to a password. The certificate is a file that is individually generated for an account on the trade server. This file is unique, and account connection is not possible without the certificate.

    In the earlier platform versions, any certificate requested and generated from the desktop terminal needed to be manually copied and installed on the device to enable use of the trading account from the MetaTrader 5 Mobile for iPhone/iPad or Android. Now, certificates can be conveniently transfered.

    The Process of Certificate Transfer
    A certificate is transfered via a trade server:

    • A certificate is first encrypted on the desktop terminal: the account owner sets the password for certificate encryption using the secure AES-256 algorithm. This password is only know to the user, while it is not sent to the server.
    • Further, the encrypted certificate is sent to the trade server, where it is stored until the mobile terminal receives it, but no more than one hour.
    • To receive the certificate on a mobile device, the user must connect to the trading account from the mobile terminal. After connecting, the user is prompted to import the certificate. To proceed with the import, the user needs to specify the password that was used for the certificate encryption on the desktop terminal.

    Certificate transfer process is secure: the trade server is only used as an intermediate storage, while the certificate is encrypted on the client's side. The certificate password is not transmitted to or stored on the trade server.

    How to Transfer a Certificate
    Connect to your account from the desktop terminal and select "Transfer Certificate" in its context menu:



    Enter the master password of the account to confirm that it belongs to you. Next, set a password to protect the certificate before sending it to the server. Set a password that has at least 8 digits.

    After successfully sending the certificate to the server, open the mobile terminal and connect to your account. You will immediately be prompted to import the certificate. Confirm and enter the password that you have set from the desktop terminal.



    You can view the imported certificate in the "About — Certificates" section.
    Updated MetaTrader 5 Platforms for iPhone/iPad and Android supporting certificate transfer will be released soon.

Tester

  1. An updated algorithm for the execution of pending orders, as well as SL ans TP, which provides more accurate testing conditions. Advanced options of visual testing.

    What's New for Exchange Instruments
    In the real market, charts of exchange-traded instruments are generated based on Last price information (the price of the last executed deal). Stop Orders also trigger at the Last price. Limit orders trigger at Bid and Ask prices. All types of orders are always executed at the current market Bid/Ask prices. The Strategy Tester has been updated and now better emulates real market conditions:
      Before
    After
    Triggering Bid/Ask for all types of Pending Orders and SL/TP
    Bid/Ask for Limit Orders
    Last for Stop, Stop-Limit and SL/TP orders
    Execution The price specified in the order for all types of Pending Orders and SL/TP
    Bid/Ask at the time of order triggering for all types of Pending Orders and SL/TP

    Let us consider an example of the Si-6.16 symbol. A new Buy Stop order with the trigger price = 72580 is set while the current prices are: Bid=72570, Ask=72572, Last=72552. New current prices are received in a price stream:

    • Bid=72588
    • Ask=72590
    • Last=72580


    A trigger for Stop-Orders of exchange instruments is the Last price. So the Last price=72580 received in the stream activates the Buy Stop order. In the earlier versions, the same price would be used to execute this order. This behavior is incorrect, because there is no Ask=72580 in the market to execute the Buy transaction.


    The current Ask=72590 is used in the updated tester version, so the Buy Stop order is executed at this price. The new trade execution algorithm in the Tester is closer to real market conditions. The trade operation would be executed at a non-market price when using the previous algorithm, which would lead to inaccurate testing results.

    What's New for Other Instruments
    The algorithm has not changed for other instruments: Bid/Ask prices are used for all types of pending orders, as well as for SL and TP. However, the execution mode has changed: in earlier versions, orders were executed at the price specified in the order. Now market Bid and Ask prices as of the time of order activation are used.

    What's New in Visual Testing
    During visual testing, the bar's High Ask and Low Bid price lines are now shown in the tester. On such charts, it is more convenient to test Expert Advisors that trade exchange instruments, because bars of such instruments, as well as order triggering are based on the Last prices, while market operations are executed at Bid and Ask prices.



    New option on the visual testing chart: navigation to a specified date. Double-click on the chart and enter the desired date and time. It is also possible to navigate to any order or trade: double-click on the appropriate trading operation on the Trade, History or Operations tab.
  2. Expanded logging of information about price and tick history loaded before testing start. The log now contains information about the completion of history loading, as well as the amount of data downloaded and time spent:
    2016.05.10 12:47:53    Core 1    5.10 Mb of history processed in 0:00.842
    2016.05.10 12:47:53    Core 1    GBPUSD: history synchronization completed [5225 Kb]

MQL5

  1. Fixed behavior of the CopyTicks function: it could return fewer ticks than was requested.
  2. Fixed generation of template functions.
  3. Updated documentation.

Fixed errors reported in crash logs.

12 May 2016

MetaTrader 5 Web Platform: Now available for beta testing

The beta version of the MetaTrader 5 Web Platform has been released. The new product combines convenience and cross-platform nature of the web terminal with the advantages of the desktop version of MetaTrader 5 – speed, support for multiple markets, and expanded trading functions.

The MetaTrader 5 web platform is available on the MQL5.community, and it allows traders to perform trading operation on financial markets from any browser and any operating system, including Windows, Mac, and Linux. You only need to have an Internet connection. No additional software is required.

The following features are available in the beta version:

  • Hedging system
  • 30 technical indicators
  • 23 analytical objects
  • Full set of MetaTrader 5 trading orders
  • Interface in 41 languages
The release of the beta version aims to provide global public testing and to allow traders to evaluate the new capabilities.

22 April 2016

MetaTrader 5 build 1325: Hedging option and testing on real ticks

Terminal

  1. We have added the second accounting system — hedging, which expands the possibilities of retail Forex traders. Now, it is possible to have multiple positions per symbol, including oppositely directed ones. This paves the way to implementing trading strategies based on the so-called "locking" — if the price moves against a trader, they can open a position in the opposite direction.

    Since the new system is similar to the one used in MetaTrader 4, it will be familiar to traders. At the same time, traders will be able to enjoy all the advantages of the fifth platform version — filling orders using multiple deals (including partial fills), multicurrency and multithreaded tester with support for MQL5 Cloud Network, and much more.

    Now, you can use one account to trade the markets that adhere to the netting system and allow having only one position per instrument, and use another account in the same platform to trade Forex and apply hedging.

    Opening a hedge account and viewing position accounting type
    A position accounting system is set at an account level and displayed in the terminal window header and the Journal:


    To open a demo account with hedging, enable the appropriate option:



    Netting system
    With this system, you can have only one common position for a symbol at the same time:

    • If there is an open position for a symbol, executing a deal in the same direction increases the volume of this position.
    • If a deal is executed in the opposite direction, the volume of the existing position can be decreased, the position can be closed (when the deal volume is equal to the position volume) or reversed (if the volume of the opposite deal is greater than the current position).

    It does not matter, what has caused the opposite deal — an executed market order or a triggered pending order.

    The below example shows execution of two EURUSD Buy deals 0.5 lots each:

    Execution of both deals resulted in one common position of 1 lot.

    Hedging system
    With this system, you can have multiple open positions of one and the same symbol, including opposite position.

    If you have an open position for a symbol, and execute a new deal (or a pending order triggers), a new position is additionally opened. Your current position does not change.

    The below example shows execution of two EURUSD Buy deals 0.5 lots each:

    Execution of these deals resulted in opening two separate positions.

    New trade operation type - Close By
    The new trade operation type has been added for hedging accounts — closing a position by an opposite one. This operation allows closing two oppositely directed positions at a single symbol. If the opposite positions have different numbers of lots, only one order of the two remains open. Its volume will be equal to the difference of lots of the closed positions, while the position direction and open price will match (by volume) the greater of the closed positions.

    Compared with a single closure of the two positions, the closing by an opposite position allows traders to save one spread:

    • In case of a single closing, traders have to pay a spread twice: when closing a buy position at a lower price (Bid) and closing a sell position at a higher one (Ask).
    • When using an opposite position, an open price of the second position is used to close the first one, while an open price of the first position is used to close the second one.

    In the latter case, a "close by" order is placed. Tickets of closed positions are specified in its comment. A pair of opposite positions is closed by two "out by" deals. Total profit/loss resulting from closing the both positions is specified only in one deal.

  2. In addition to hedging support, the new platform version provides wider opportunities for migrating accounts from MetaTrader 4. Now, brokers can automatically transfer accounts to MetaTrader 5, including all operations: open and pending orders, and complete trading history.

    A welcome dialog appears when first connecting to the account migrated from MetaTrader 4. Data transmission is securely encrypted during migration. To get started, specify the password of your account that you used in MetaTrader 4, and then set a new password.


    Once connected, you will be able to continue using your account, just as if it has been opened in MetaTrader 5. The complete history of all trades from MetaTrader 4 is automatically added to the new account.

    The tickets of orders and positions (including history orders) are not preserved during import, because one history record from MetaTrader 4 can be imported as up to 4 history operations in MetaTrader 5. New tickets are assigned to all trading records.

    The account numbers can be preserved or replaced depending on how the broker imports them.

  3. Added the Chat. Now, you can communicate with your MQL5.community friends and colleagues. The chat displays all personal messages from your MQL5 account. To start communicating, log in to your account directly from the chat window or via the platform settings: Tools -> Options -> Community.



  4. Simplified demo account creation dialog, added ability to create hedge accounts. You do not have to fill the large form any more. Simply specify basic data and select trading parameters: account type, deposit, leverage, and hedging ability.


  5. Added automatic allocation of a demo account for quick start. If the platform has no accounts yet, a demo account on the first available trade server is allocated during the launch. After successful opening, connection to the account is established immediately.

  6. Now, each position has a ticket — a unique number. It usually matches the ticket of an order used to open the position except when the ticket is changed as a result of service operations on the server, for example, when charging swaps with position re-opening. A ticket is assigned automatically to all available positions after the terminal update.


  7. Fixed setting Stop Loss and Take Profit levels when placing a market order leading to a position reversal. Until recently, no appropriate levels were set for a new position.
  8. Fixed displaying prices with four and more decimal places on the one-click trading panel elements.
  9. Fixed displaying news in the print preview window.
  10. Fixed tick chart display.
  11. Fixed opening the Market Depth after the terminal emergency shutdown.
  12. Added a check if market orders are allowed when displaying one-click trading panel control elements.
  13. Optimized profit and margin calculation in case of a large number of open orders and positions.
  14. Added translation of the user interface into Malay.
  15. Fully revised the user manual. New design, interactive screenshots and embedded videos — learn trading in MetaTrader 5 with maximum convenience:


  16. Fixed display of graphical objects in the "Chart on foreground" mode.

Tester

  1. Added ability to test trading robots and technical indicators in real tick history.

    Testing and optimization on real ticks are as close to real conditions as possible. Instead of generated ticks based on minute data, it is possible to use real ticks accumulated by a broker. These are ticks from exchanges and liquidity providers.

    To start testing or optimization in real ticks, select the appropriate mode in the strategy tester:


    Tick data has greater size compared to minute one. Downloading it may take quite a long time during the first test. Downloaded tick data is stored by months in TKC files in \bases\[trade server name]\ticks\[symbol name]\.

    Testing on real ticks
    When testing on real ticks, a spread may change within a minute bar, whereas when generating ticks within a minute, a spread fixed in the appropriate bar is used.

    If the Market Depth is displayed for a symbol, the bars are built strictly according to the last executed trade price (Last). Otherwise, the tester first attempts to build the bars by Last prices, and in case of their absence, uses Bid ones. OnTick event is triggered on all ticks regardless of whether the Last price is present or not.

    Please note that trading operations are always performed by Bid and Ask prices even if the chart is built by Last prices. For example, if an Expert Advisor using only bar open prices for trading (i.e., the built-in Moving Average) receives a signal at Last price, it performs a trade at another price (Bid or Ask depending on the direction). If "Every tick" mode is used, the bars are built by Bid prices, while trades are performed by Bid and Ask ones. The Ask price is calculated as Bid + fixed spread of a corresponding minute bar.

    If a symbol history has a minute bar with no tick data for it, the tester generates ticks in the "Every tick" mode. This allows testing the EA on a certain period in case a broker's tick data is insufficient. If a symbol history has no minute bar but the appropriate tick data for the minute is present, these ticks are ignored. The minute data is considered more reliable.

    Testing on real ticks in the MQL5 Cloud Network
    Testing on real ticks is available not only on local and remote agents, but also through the MQL5 Cloud Network. Optimization of a strategy that could take months, can be completed in a few hours using the computing power of thousands of computers.

    To test a strategy using the MQL5 Cloud Network, enable the use of cloud agents:


    Tests on real ticks using the MQL5 Cloud Network can consume a lot of data. This can significantly affect the payment for the use of the network power.
  2. Fixed an error that hindered the calculation of commission on several trading symbol types.
  3. Fixed filling Expert field for trading orders resulting from SL/TP activation according to the Expert field of the corresponding position. Previously, it was not filled.
  4. Fixed switching to usual and forward optimization results' tabs.
  5. Fixed calculation and display of the "Envelopes" indicator.
  6. Optimized visual testing.
  7. Optimized profit and margin calculation in case of a large number of open orders and positions.
  8. Optimized trading operations during high-frequency trading.
  9. Now, history synchronization is not performed if a request for non-critical symbol's properties (not requiring the current quotes) has been made. For example, SYMBOL_SELECT, SYMBOL_DIGITS, SYMBOL_SPREAD_FLOAT, SYMBOL_TRADE_CALC_MODE, SYMBOL_TRADE_MODE, SYMBOL_TRADE_STOPS_LEVEL, SYMBOL_TRADE_FREEZE_LEVEL, SYMBOL_TRADE_EXEMODE, etc. Previously, the non-critical symbol history was synchronized at any request for its property.
  10. Fixed calculation of swaps as a percentage per annum.

MQL5

  1. The format of the executable EX5 files has changed to implement the new features of the MQL5 language and the new hedging option in MetaTrader 5. All EX5 applications compiled in previous builds of MetaEditor will work properly after the update, i.e. the upward compatibility is fully preserved.

    EX5 programs compiled in build 1325 and above will not run in old terminal builds - backward compatibility is not supported.

  2. Added support for abstract classes and pure virtual functions.

    Abstract classes are used for creating generic entities that you expect to use for creating more specific derived classes. An abstract class can only be used as the base class for some other class, that is why it is impossible to create an object of the abstract class type.

    A class which contains at least one pure virtual function in it is abstract. Therefore, classes derived from the abstract class must implement all its pure virtual functions, otherwise they will also be abstract classes.

    A virtual function is declared as "pure" by using the pure-specifier syntax. Consider the example of the CAnimal class, which is only created to provide common functions – the objects of the CAnimal type are too general for practical use. Thus, CAnimal is a good example for an abstract class:
    class CAnimal
      {
    public:
                          CAnimal();     // Constructor
       virtual void       Sound() = 0;   // A pure virtual function
    private:
       double             m_legs_count;  // How many feet the animal has
      };
    Here Sound() is a pure virtual function, because it is declared with the specifier of the pure virtual function PURE (=0).

    Pure virtual functions are only the virtual functions for which the PURE specifier is set: (=NULL) or (=0). Example of abstract class declaration and use:
    class CAnimal
      {
    public:
       virtual void       Sound()=NULL;   // PURE method, should be overridden in the derived class, CAnimal is now abstract and cannot be created
      };
    //--- Derived from an abstract class
    class CCat : public CAnimal
     {
    public:
      virtual void        Sound() { Print("Myau"); } // PURE is overridden, CCat is not abstract and can be created
     };
    
    //--- examples of wrong use
    new CAnimal;         // Error of 'CAnimal' - the compiler returns the "cannot instantiate abstract class" error
    CAnimal some_animal; // Error of 'CAnimal' - the compiler returns the "cannot instantiate abstract class" error
    
    //--- examples of correct use
    new CCat;  // no error - the CCat class is not abstract
    CCat cat;  // no error - the CCat class is not abstract
    Restrictions on abstract classes
    If the constructor for an abstract class calls a pure virtual function (either directly or indirectly), the result is undefined.
    //+------------------------------------------------------------------+
    //| An abstract base class                                           |
    //+------------------------------------------------------------------+
    class CAnimal
      {
    public:
       //--- a pure virtual function
       virtual void      Sound(void)=NULL;
       //--- function
       void              CallSound(void) { Sound(); }
       //--- constructor
       CAnimal()
        {
         //--- an explicit call of the virtual method
         Sound();
         //--- an implicit call (using a third function)
         CallSound();
         //--- a constructor and/or destructor always calls its own functions,
         //--- even if they are virtual and overridden by a called function in a derived class
         //--- if the called function is purely virtual
         //--- the call causes the "pure virtual function call" critical execution error
        }
      };
    However, constructors and destructors for abstract classes can call other member functions.

  3. Added support for pointers to functions to simplify the arrangement of event models.

    To declare a pointer to a function, specify the "pointer to a function" type, for example:
    typedef int (*TFunc)(int,int);
    Now, TFunc is a type, and it is possible to declare the variable pointer to the function:
    TFunc func_ptr;
    The func_ptr variable may store the function address to declare it later:
    int sub(int x,int y) { return(x-y); }
    int add(int x,int y) { return(x+y); }
    int neg(int x)       { return(~x);  }
    
    func_ptr=sub;
    Print(func_ptr(10,5));
    
    func_ptr=add;
    Print(func_ptr(10,5));
    
    func_ptr=neg;           // error: neg is not of  int (int,int) type
    Print(func_ptr(10));    // error: there should be two parameters
    Pointers to functions can be stored and passed as parameters. You cannot get a pointer to a non-static class method.

  4. MqlTradeRequest features two new fields:

    • position — position ticket. Fill it when changing and closing a position for its clear identification while trading in hedging mode. In the netting system, filling the field does not affect anything since positions are identified by a symbol name.
    • position_by — opposite position ticket. It is used when closing a position by an opposite one (opened at the same symbol but in the opposite direction). The ticket is used only in the hedging system.

  5. Added TRADE_ACTION_CLOSE_BY value to the ENUM_TRADE_REQUEST_ACTIONS enumeration of trading operation types — close a position by an opposite one. The ticket is used only in the hedging system.

  6. Added trading operation tickets to the enumerations of the appropriate order, deal, and position properties:

    • Added ORDER_TICKET property to ENUM_ORDER_PROPERTY_INTEGER — order ticket. Unique number assigned to each order.
    • Added DEAL_TICKET property to ENUM_DEAL_PROPERTY_INTEGER — deal ticket. Unique number assigned to each deal.
    • Added POSITION_TICKET property to ENUM_POSITION_PROPERTY_INTEGER — position ticket. Unique number assigned to each newly opened position. It usually matches the ticket of an order used to open the position except when the ticket is changed as a result of service operations on the server, for example, when charging swaps with position re-opening. To find an order used to open a position, apply the POSITION_IDENTIFIER property. POSITION_TICKET value corresponds to MqlTradeRequest::position.

  7. Added ORDER_TYPE_CLOSE_BY value to the ENUM_ORDER_TYPE order type enumeration — close by order.
  8. Added ORDER_POSITION_BY_ID value to the ENUM_ORDER_PROPERTY_INTEGER order property enumeration — opposite position identifier for ORDER_TYPE_CLOSE_BY type orders.
  9. Added DEAL_ENTRY_OUT_BY value to the ENUM_DEAL_ENTRY deal direction enumeration — a deal is performed as a result of a close by operation.
  10. MqlTradeTransaction also features the two similar fields:

    • position — ticket of a position affected by transaction. It is filled for transactions related to handling market orders (TRADE_TRANSACTION_ORDER_* except TRADE_TRANSACTION_ORDER_ADD, where a position ticket is not assigned yet) and order history (TRADE_TRANSACTION_HISTORY_*).
    • position_by — opposite position ticket. It is used when closing a position by an opposite one (opened at the same symbol but in the opposite direction). It is filled only for orders closing a position by an opposite one (close by) and deals closing by an opposite one (out by).

  11. Added PositionGetTicket function — return a position ticket by an index in the list of open positions and automatically select that position for further work using the PositionGetDouble, PositionGetInteger, and PositionGetString functions.
    ulong  PositionGetTicket(
       int  index      // index in the list of positions
       );

  12. Added PositionSelectByTicket function — select an open position for further work by a specified ticket.
    bool  PositionSelectByTicket(
       ulong   ticket     // position ticket
       );

  13. Added SYMBOL_MARGIN_HEDGED value to the ENUM_SYMBOL_INFO_DOUBLE trade symbol property enumeration — size of a contract or margin for one lot of hedged positions (oppositely directed positions at one symbol).

    • If the initial margin (SYMBOL_MARGIN_INITIAL) is specified for a symbol, the hedged margin is specified as an absolute value (in monetary terms).
    • If the initial margin is not set (equal to 0), a contract size to be used in the margin calculation is specified in SYMBOL_MARGIN_HEDGED. The margin is calculated using the equation that corresponds to a trade symbol type (SYMBOL_TRADE_CALC_MODE).

    Margin calculation for hedged positions is described in details in the MetaTrader 5 trading platform Help.

  14. Added ACCOUNT_MARGIN_MODE value to the ENUM_ACCOUNT_INFO_INTEGER account property enumeration — mode of margin calculation for the current trading account:

    • ACCOUNT_MARGIN_MODE_RETAIL_NETTING — used for the over-the-counter market when accounting positions in the netting mode (one position per symbol). Margin calculation is based on a symbol type (SYMBOL_TRADE_CALC_MODE).
    • ACCOUNT_MARGIN_MODE_EXCHANGE — used on the exchange markets. Margin calculation is based on the discounts specified in symbol settings. Discounts are set by the broker, however they cannot be lower than the exchange set values.
    • ACCOUNT_MARGIN_MODE_RETAIL_HEDGING — used for the over-the-counter market with independent position accounting (hedging, there can be multiple positions at a single symbol). Margin calculation is based on a symbol type (SYMBOL_TRADE_CALC_MODE). The hedged margin size (SYMBOL_MARGIN_HEDGED) is also considered.

  15. Added TERMINAL_SCREEN_DPI value to the ENUM_TERMINAL_INFO_INTEGER client terminal property enumeration — data display resolution is measured in dots per inch (DPI). Knowledge of this parameter allows specifying the size of graphical objects, so that they look the same on monitors with different resolution.

  16. Added TERMINAL_PING_LAST value to the ENUM_TERMINAL_INFO_INTEGER client terminal properties — the last known value of a ping to a trade server in microseconds. One second comprises of one million microseconds.

  17. Fixed return of the SendFTP function call result. Previously, FALSE was returned after a successful sending instead of TRUE.
  18. MQL5: Fixed an error in StringConcatenate function that occasionally caused "Access violation" execution error.
  19. Fixed a few errors occurred when working with template functions.
  20. Added ability to display lines exceeding 4000 characters for Print, Alert, and Comment functions.
  21. Fixed an error in ArrayCompare function that occurred when comparing an array to itself but with different initial position shift from the beginning.
  22. Added support for hedging to Standard Library:

    CPosition
    Added methods:

    • SelectByMagic — select position by a magic number and symbol for further work.
    • SelectByTicket — select position by a ticket for further work.

    CTrade
    Added methods:

    • RequestPosition — receive a position ticket.
    • RequestPositionBy — receive an opposite position ticket.
    • PositionCloseBy — close a position with the specified ticket by an opposite position.
    • SetMarginMode — set margin calculation mode according to the current account settings.

    Added overloading for the methods:

    • PositionClose — close position by ticket.
    • PositionModify — modify position by ticket.

    CAccountInfo
    Changed the methods:

    • MarginMode — receive margin calculation mode. Until recently, the method worked similarly to the new StopoutMode method.
    • MarginDescription — receive margin calculation mode as a string. Until recently, the method worked similarly to the new StopoutModeDescription method.

    Added methods:

    • StopoutMode — receive minimum margin level specification mode.
    • StopoutModeDescription — receive minimum margin level specification mode as a string.

    CExpert
    Added methods:

    • SelectPosition — select a position for further work.

  23. Added a few improvements to the Standard Library.
  24. Fixed unloading of DLLs.
  25. Added support for template class constructors.

Signals

  1. Fixed a few trading signals showcase display errors.

MetaEditor

  1. Fixed search of words by files in "Match Whole Word Only" mode.
  2. Added moving to a file by double-clicking on the necessary file's compilation result line.
  3. Fixed display of some control elements in Windows XP.
Updated documentation.

31 March 2016

MetaTrader 5 iOS build 1261
  1. The trading platform now additionally supports the second position accounting system — Hedging. The new system allows opening multiple positions of the same financial instrument, including opposite positions. Now, the platform provides both exchange trading with the netting system and Forex trading with one of the two available systems.

    The new position accounting system is similar to that of MetaTrader 4, combined with all the advantages of the fifth-generation platform — execution of orders using multiple deals (including partial filling), stop-limit orders, and more.

    Update the platform right now to see how the hedging option works. When opening a new demo account, enable the \"Use hedge\" option. The option will be available if your broker's server has already been updated and configured.

  2. Also, the new version includes minor bug fixes and improvements.

31 March 2016

MetaTrader 5 Android build 1226
  1. The trading platform now additionally supports the second position accounting system — Hedging. The new system allows opening multiple positions of the same financial instrument, including opposite positions. Now, the platform provides both exchange trading with the netting system and Forex trading with one of the two available systems.

    The new position accounting system is similar to that of MetaTrader 4, combined with all the advantages of the fifth-generation platform — execution of orders using multiple deals (including partial filling), stop-limit orders, and more.

    Update the platform right now to see how the hedging option works. When opening a new demo account, enable the "Use hedge" option. The option will be available if your broker's server has already been updated and configured.

  2. Also, the new version includes minor bug fixes and improvements.

12 February 2016

MetaTrader 5 Android build 1224
  • A new window has been added to the tablet version to show the detailed information about trading operations. Tap on an order or a trade to view its Open and Close time to the nearest second, a comment and the amount of the broker's commission.
  • Improved news section. Select news categories to follow what is interesting for you. Add the news items you like to Favorites to quickly access them wherever you need.
  • Added period separators to show the borders of higher timeframes on a chart.
  • Added display of the Ask line on a chart.
  • New interface languages: Korean and Vietnamese.
  • Increased maximum number of objects on a chart.
  • Various bug fixes and improvements.

3 February 2016

MetaTrader 5 iOS build 1225
  • Added portrait mode for iPad. Now, you can browse through long lists of trading operations, as well as read your mail and financial news more conveniently.
  • Added native support for iPad Pro.
  • Added Korean language.

17 December 2015

MetaTrader 5 Platform Build 1240: Faster operation and embedded videos

Virtual Hosting

  1. Added a link to the tutorial video "How to Rent A Virtual Platform" into the Virtual Hosting Wizard dialog. Watch this two-minute video to learn how to easily launch a trading robot or copy signals 24/7.


    This video as well as many others is available on the official MetaQuotes Software Corp. YouTube channel.
  2. Fixed migration for hosting when a custom indicator is called or an EX5 library within a custom indicator is called from an Expert Advisor.

Terminal

  1. Accelerated update of the list of open orders and positions during high-frequency trading (50 and more operations per second).
  2. Optimized and greatly accelerated initial synchronization of the terminal with a trade server in case of a large amount of symbols (tens of thousands). Now, you can start working much faster after connection is established.
  3. Optimized and significantly reduced memory consumption by the terminal.
  4. Added saving and restoring the depth of market settings when closing/opening the terminal.
  5. Fixed artifacts that occurred in Windows 10 when dragging the terminal windows.
  6. Fixed the context help for a number of commands and dialogs. For activating help concerning a certain element, move the cursor on it and press F1.
  7. The works on adapting the interface for high resolution screens (4K) are underway.

MQL5

  1. Added the new properties for the OrderGetString, HistoryOrderGetString, and HistoryDealGetString functions responsible for receiving data on orders and deals:

    • ORDER_EXTERNAL_ID - order ID in an external trading system (on the exchange).
    • DEAL_EXTERNAL_ID - deal ID in an external trading system.

  2. Fixed the ZeroMemory function operation when working with structures and classes. Memory clearing was not performed in some cases.
  3. Added the error codes during the SendFTP function operation. The function sends the file to the address specified on the FTP tab of the Options window.

    • ERR_FTP_NOSERVER - FTP server is not specified in the settings
    • ERR_FTP_NOLOGIN - FTP login is not specified in the settings
    • ERR_FTP_FILE_ERROR - file does not exist
    • ERR_FTP_CONNECT_FAILED - failed to connect to the FTP server
    • ERR_FTP_CHANGEDIR - file upload directory not found on the FTP server
    • ERR_FTP_CLOSED - connection to the FTP server closed

  4. Fixed type casting access by inheritance between child class objects and their parents.
  5. Fixed a few errors in the class templates.
  6. Fixed requesting ticks using the CopyTicks function. When specifying the COPY_TICKS_TRADE parameter (copy only trade ticks) for consecutive identical trade ticks (identical volume and last price), only the first tick was passed.
  7. Fixed defining a size of a custom type variable.
  8. Fixed an error when using ZLib in the CryptDecode function that led to an infinite unzip loop.

Tester

  1. Fixed synchronization of the price history for a symbol different from the main test one.
  2. Fixed doubling of the TRADE_TRANSACTION_DEAL_ADD transaction (adding a trade to history) in the OnTradeTransaction event handler.
  3. Changed forward test behavior during genetic optimization. Now, all unique results obtained after genetic optimization participate in forward passes. Previously, only 1/4 of the results were used.

MetaEditor

  1. MetaEditor: Added a link to the tutorial video "How to Create a Trading Robot in the MQL5 Wizard" to the MQL5 Wizard. Watch this three-minute video and develop a trading robot without writing a single line of code.


    This video as well as many others is available on the official MetaQuotes Software Corp. YouTube channel.
  2. Fixed window arrangement commands if one of the windows is fully expanded. The Window menu allows you to arrange open files as tiles, vertically, horizontally and as a cascade.
  3. The works on adapting the interface for high resolution screens (4K) are underway.
Updated documentation.

4 November 2015

MetaTrader 5 Android Build 1172: Convenient Chart Zoom and Accrued Interest in the Bond Properties

The new version of the MetaTrader 5 Android is already available for download on Google Play.


What's new:

  1. Improved symbol chart zoom: increased the amount of zoom steps and enhanced display smoothness.
  2. All changes in the set of symbols and their sequence in the Market Watch and chart settings (scale, color scheme, object and indicator lists) are saved after closing the application in any way.
  3. Added a face value and accrued interest in bond properties.

Update your application and try its new features!


3 November 2015

MetaTrader 5 Android build 1172
  • Improved symbol chart zoom: increased the amount of zoom steps and enhanced display smoothness.
  • All changes in the set of symbols and their sequence in the Market Watch and chart settings (scale, color scheme, object and indicator lists) are saved after closing the application in any way.
  • Added a face value and accrued interest in bond properties.

30 October 2015

MetaTrader 5 Build 1210: Enhanced Depth of Market and General Improvements

Terminal

  1. Added ability to place limit orders at a price worse than the market one in the Depth of Market. This allows you to get a guaranteed order execution at a specified price on the market.

    If we drag a limit order through ask/bid border, it will change to a stop order (Buy Limit will be replaced by Buy Stop, while Sell Limit - by Sell Stop). Hold Crtl while dragging so that a limit order is not replaced by a stop one.




  2. Added the "Show quick trading buttons" option in the chart settings. It allows you to hide the One Click Trading panel enabling buttons and the Depth of Market from a chart.




  3. Fixed occasional conflicts between tooltips and other applications.

MQL5

  1. Fixed the operation of the Copy* functions for copying history data with dynamic arrays having the AS_SERIES flag. The flag is set by the ArraySetAsSeries function and indicates that indexation of the array elements is performed as in timeseries.
  2. Changed the CHART_SHOW_ONE_CLICK property managed via ChartSetInteger and ChartGetInteger. Previously, the property allowed showing/hiding the One Click Trading panel on a chart. Now, it also shows/hides the buttons for setting the One Click Trading panel and the Depth of Market on a chart (similar to the "Show quick trading buttons" in the chart settings).
  3. Fixed template operation.
Updated documentation.

23 October 2015

MetaTrader 5 Platform Update Build 1200: Tick History and Direct Payment for Services

Terminal

  1. Added ability to work with tick history in the Market Watch. Previously, a tick chart showed only the history collected in the terminal during its operation. Now, you can access the entire tick history on the trade server. Disable auto scroll and start scrolling a tick chart back in time using your mouse to download missing history from the trade server the same way it is done for common price charts. The new feature will be useful for traders who want to get the most detailed price charts.



    Use the CopyTicks() function to receive deeper tick history. It has been modified so that it requests missing history and downloads it if the latter is present on the trade server.

  2. Added an icon for quick opening/closing the Depth of Market. The icon is located near the One-Click Trading panel on the chart. You can also use the new hotkey Alt+B. The hotkey also works in the Market Watch window opening the Depth of Market for a symbol highlighted in the Market Watch.




  3. Information about the PC hardware characteristics and the operating system is now logged to a Journal at the start of the client terminal. Example:
    2015.10.14 14:48:18.486	Data Folder: C:\Program Files\MetaTrader 5
    2015.10.14 14:48:18.486	Windows 7 Professional (x64 based PC), IE 11.00, UAC, 8 x Intel Core i7  920 @ 2.67GHz, RAM: 8116 / 12277 Mb, HDD: 534262 / 753865 Mb, GMT+03:00
    2015.10.14 14:48:18.486	MetaTrader 5 build 1190 started (MetaQuotes Software Corp.)
  4. Imrpoved working with the symbols in the Market Watch:

    • Added display of the amount of symbols in the Market Watch and the total available amount of symbols on the trade server
    • Added a line for adding a new symbol with the smart selection list
    • The search in the new symbol line is performed not only by a symbol name, but also by its description and international name.




  5. Added support for the economic calendar in different languages.
  6. Added missing country icons to the economic calendar.
  7. Added the hotkey for opening the symbol management window in the Market Watch - Ctrl+U.
  8. Fixed arranging open chart windows according to the Window menu commands.
  9. Fixed an error that occasionally hampered the terminal's ability to find a certificate file when using the enhanced authentication.
  10. Fixed an error that could occasionally lead to a price history synchronization looping.
  11. Fixed nulling StopLoss/TakeProfit levels of a previously opened position after its volume has been increased if a symbol is traded in the Request Execution mode.
  12. Fixed checking the ability to place a sell order in case of a long position on symbols in "Long only" trading mode in the Depth of Market.
  13. Fixed Trailing Stop function operation. In some rare cases, a protective Stop Loss for an open position was moved incorrectly.
  14. The terminal interface has been further adapted for high resolution screens (4K).
  15. Fixed unloading history data as being excessive despite regular appeals to it from MQL5 programs.
  16. Fixed display of some user interface elements when working in Windows 10.
  17. Updated translations of the user interface.

Market

  1. Market: Operation with the product database in the MQL5 Market has been revised and optimized.
  2. Market: Purchasing without an MQL5.community account has been disabled for terminals on VPS. The purchase now requires specification of an MQL5.community account in the terminal setting: Tools - Options - Community.
  3. Market: Added direct product purchasing using UnionPay.
  4. Market: Enhanced logging when purchasing products in MQL5 Market.
  5. Hosting: Added managing the virtual hosting (except for migration) when working in the 32-bit version of the client terminal.


Virtual Hosting and Signals

  1. Payments for Virtual Hosting and Signal subscriptions can now be transferred straight from payment systems. To pay for hosting services, users don't need to log in to the MQL5.community account and add money to it. A payment for a service can now be transferred straight from the platform using one of the available payment systems.



    Select one of the available systems and make an online money transfer:




    Similarly, a payment for a trading signal subscription can be made straight from the terminal via a payment system.




    The required amount will be transferred to your MQL5.community account first, from which a payment for the service will be made. Thus, you maintain a clear and unified history of rented virtual hosting platforms and signal subscriptions and can easily access and review all your payments for the MQL5.community services.
  2. Added managing the virtual hosting (except for migration) when working in the 32-bit version of the client terminal.
  3. Fixed migration of FTP export settings to the virtual hosting regardless of the permission to publish reports via FTP.

MQL5

  1. Enabled a new optimizing compiler. Execution of programs has been accelerated up to 5 times on 64-bit platofrms. MQL5 programs should be re-compiled in the last MetaEditor version.
  2. Extended MqlTick structure format. Now, it passes the time of a tick arrival in milliseconds, as well as flags to determine which tick parameter has been changed.
    struct MqlTick
      {
       datetime     time;          // Time of a price last update
       double       bid;           // Current Bid price
       double       ask;           // Current Ask price
       double       last;          // Current Last price
       ulong        volume;        // Volume for the current Last price
       long         time_msc;      // Time of a price last update in milliseconds
       uint         flags;         // Tick flags
      };
    The parameters of each tick are filled in regardless of whether there are changes compared to the previous tick. Thus, it is possible to find out a correct price for any moment in the past without the need to search for previous values at the tick history. For example, even if only a Bid price changes during a tick arrival, the structure still contains other parameters as well, including the previous Ask price, volume, etc. You can analyze the tick flags to find out what data have been changed exactly:

    • TICK_FLAG_BID - a tick has changed a Bid price
    • TICK_FLAG_ASK  - a tick has changed an Ask price
    • TICK_FLAG_LAST - a tick has changed the last deal price
    • TICK_FLAG_VOLUME - a tick has changed a volume
    • TICK_FLAG_BUY - a tick is a result of a buy deal
    • TICK_FLAG_SELL - a tick is a result of a sell deal

    The MqlTick structure is used in two methods:

    • CopyTicks - method does not support the old format of the structure. Previously compiled EX5 files using the old tick format will return the error 4006 (ERR_MQL_INVALID_ARRAY) when calling the CopyTicks function.
    • SymbolInfoTick - method supports both old and new structure format.

  3. Added class templates allowing you to create parametrized classes like in C++. That enables even greater abstraction and ability to use the same code for working with objects of different classes in a uniform manner. Example of use:
    //+------------------------------------------------------------------+
    //|                                                    TemplTest.mq5 |
    //|                        Copyright 2015, MetaQuotes Software Corp. |
    //|                                             https://www.mql5.com |
    //+------------------------------------------------------------------+
    #property copyright "Copyright 2015, MetaQuotes Software Corp."
    #property link      "https://www.mql5.com"
    #property version   "1.00"
    //+------------------------------------------------------------------+
    //| Declare a template class                                         |
    //+------------------------------------------------------------------+
    template<typename T>
    class TArray
      {
    protected:
       T                 m_data[];
    
    public:
    
       bool              Append(T item)
         {
          int new_size=ArraySize(m_data)+1;
          int reserve =(new_size/2+15)&~15;
          //---
          if(ArrayResize(m_data,new_size,reserve)!=new_size)
             return(false);
          //---
          m_data[new_size-1]=item;
          return(true);
         }
       T                 operator[](int index)
         {
          static T invalid_index;
          //---
          if(index<0 || index>=ArraySize(m_data))
             return(invalid_index);
          //---
          return(m_data[index]);
         }   
      };
    //+------------------------------------------------------------------+
    //| Template class of a pointer array. In the destructor, it deletes |
    //| the objects, the pointers to which were stored in the array.     |
    //|                                                                  |
    //| Please note the inheritance from the TArray template class       |
    //+------------------------------------------------------------------+
    template<typename T>
    class TArrayPtr : public TArray<T *>
      {
    public:
       void             ~TArrayPtr()
         {
          for(int n=0,count=ArraySize(m_data);n<count;n++)
             if(CheckPointer(m_data[n])==POINTER_DYNAMIC)
                delete m_data[n];
         }
      };
    //+--------------------------------------------------------------------------+
    //| Declare the class. Pointers to its objects will be stored in the array   |
    //+--------------------------------------------------------------------------+
    class CFoo
      {
       int               m_x;
    public:
                         CFoo(int x):m_x(x) { }
       int               X(void) const { return(m_x); }
      };
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    TArray<int>     ExtIntArray;   // instantiate TArray (specialize TArray by the int type)
    TArray<double>  ExtDblArray;   // instantiate TArray (specialize TArray by the double type)
    TArrayPtr<CFoo> ExtPtrArray;   // instantiate TArrayPtr (specialize TArrayPtr by the CFoo type)
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
      {
    //--- fill arrays with data
       for(int i=0;i<10;i++)
         {
          int integer=i+10;
          ExtIntArray.Append(integer);
          
          double dbl=i+20.0;
          ExtDblArray.Append(dbl);
          
          CFoo *ptr=new CFoo(i+30);
          ExtPtrArray.Append(ptr);
         }
    //--- output the array contents
       string str="Int:";
       for(int i=0;i<10;i++)
          str+=" "+(string)ExtIntArray[i];      
       Print(str);   
       str="Dbl:";
       for(int i=0;i<10;i++)
          str+=" "+DoubleToString(ExtDblArray[i],1);
       Print(str);   
       str="Ptr:";
       for(int i=0;i<10;i++)
          str+=" "+(string)ExtPtrArray[i].X();      
       Print(str);
    //--- CFoo objects created via new should not be deleted, since they are deleted in the TArrayPtr<CFoo> object destructor  
      }
    Execution result:
    TemplTest (EURUSD,H1)    Int: 10 11 12 13 14 15 16 17 18 19
    TemplTest (EURUSD,H1)    Dbl: 20.0 21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0
    TemplTest (EURUSD,H1)    Ptr: 30 31 32 33 34 35 36 37 38 39

  4. New operations * and & for receiving a variable by reference and receiving a reference to a variable.
  5. Added the overloaded form of the ObjectsDeleteAll function - delete all objects of a specified type by a name prefix in a chart subwindow.
    int  ObjectsDeleteAll(
       long           chart_id,   // chart ID
       const string     prefix,   // object name prefix
       int       sub_window=-1,   // window index
       int      object_type=-1    // object type for deletion
       );

  6. Fixed the ObjectGetValueByTime function operation. Previously, an incorrect price value by a chart time could sometimes be returned (for example, for a horizontal trend line).
  7. Fixed operation of the Copy* functions in the absence of historical data on the server. Previously, such cases caused delays of 30-50 seconds before returning control.
  8. Added a few improvements to the MQL5 Standard Library.
  9. Translated the Standard Library documentation into German, French, Chinese, Turkish, Spanish and Portuguese.
  10. Added MQL5 documentation in Japanese.

Tester

  1. The process of selecting programs to run in the Strategy Tester has become much easier. The list is displayed now as a tree in accordance with the directories in which Expert Advisors and indicators are stored.




  2. Brought display of some indicators during a visualized test in line with the client terminal.
  3. Fixed setting a leverage and a chart timeframe while debugging MQL5 programs via the strategy tester.
  4. Fixed debugging indicators when testing on history.
Fixed errors reported in crash logs.

Updated documentation.


17 September 2015

MetaTrader 5 iOS build 1167
  • Improved convenience of analytical objects. They only appear on the current chart now. Display on other symbols can be enabled in object settings. To optimize chart area, enable object display only for the timeframes you need.
  • Turn on the display of higher timeframe borders on the current chart by enabling period separators.
  • iOS 9 compatibility improved.

16 September 2015

MetaTrader 5 iOS Build 1167: More Convenient Use of Analytical Objects

Working with analytical objects has become even more convenient in the new version of MetaTrader 5 iOS iOS for iPhone and iPad. Now objects only appear on the chart of the current symbol and selected timeframes.

MetaTrader 5 iOS Build 1167

Additionally, the new version of the mobile app has better compatibility with iOS 9.



28 August 2015

MetaTrader 5 iOS Build 1165: Improved News Section and One-Tap Trading

The updated MetaTrader 5 for iOS is now available on the App Store. Working with financial news has become even easier: select news categories to follow and add news items that you like to Favorites.

Another important new option added is trading from a chart with a single touch (similar to one-click trading). Turn your device into a horizontal position and open a quick trade panel.

MetaTrader 5 iOS Build 1165

Furthermore, we have added an option for closing positions of Collateral instruments, which allows converting the corresponding assets into the deposit currency.

Update your app to receive the new features in your MetaTrader 5 iOS.



28 August 2015

MetaTrader 5 iOS build 1165
  • Improved news section. Select news categories to follow what is interesting for you. Add the news items you like to Favorites to quickly access them wherever you need. Search news by headlines.
  • In the iPhone version trades can now be executed from a chart at a single tap - turn the device into a horizontal position and open a quick trade panel.
  • Added an option for closing positions of Collateral instruments, which allows converting the corresponding assets into the deposit currency.
  • Various bug fixes and improvements.

26 August 2015

MetaTrader 5 Android build 1164
  • Added 24 new graphic objects for technical analysis: lines, channels, Gann and Fibonacci tools, Elliott Waves and geometric shapes.
  • Added support of two factor authentication (One-time password, OTP) for connecting to a trading account
  • Various bug fixes and improvements

24 June 2015

MetaTrader 5 Android build 1130
  • Added internal mail system for contacting broker's support team
  • Added ability to send logs to the application developer's support team
  • Various bug fixes and improvements

3 June 2015

MetaTrader 5 iOS build 1127
  • Added support for a special type of non-tradable instruments, which can be used as the client's assets to provide the required margin for open positions of other instruments. Such assets are displayed as open positions. They increase the free margin amount, thus increasing the volumes of allowable trade operations on the account.
  • New interface language: Hindi.
  • Various bug fixes and improvements.
123456789