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

What's new in MetaTrader 5

23 October 2015

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.