Get Trial

MetaTrader 5 Build 1570: improved Market showcase and extended MQL5 template functions

What's new in MetaTrader 5

24 March 2017

Terminal

  1. Updated the showcase of the MetaTrader Market store of applications. Now, you can browse through trading robots and technical indicators more conveniently. We have updated the design and added product selections:

    • The main page now features popular experts, indicators, new Market products, as well as top free applications.
    • The Experts, Indicators and Utilities sections now have subsections: grid and hedging robots, trend and multi-currency indicators, and much more.



  2. Fixed the client terminal update and built-in purchases in the Market, Signals and Virtual Hosting when using a Windows account with limited rights.
  3. Fixed occasional incorrect sorting of position history.
  4. Optimized and fixed display of the Exposure tab.

MQL5

  1. Added support for overloading template functions using parameters. For example, we have a template function that writes the value of the second parameter to the first one using typecasting. MQL5 does not allow typecasting string to bool. However, we can do that ourselves. Let's create an overload of a template function:
    //+------------------------------------------------------------------+
    //| Template function                                                |
    //+------------------------------------------------------------------+
    template<typename T1,typename T2>
    string Assign(T1 &var1,T2 var2)
      {
       var1=(T1)var2;
       return(__FUNCSIG__);
      }
    //+------------------------------------------------------------------+
    //| Special overload for bool+string                                 |
    //+------------------------------------------------------------------+
    string Assign(bool &var1,string var2)
      {
       var1=(StringCompare(var2,"true",false) || StringToInteger(var2)!=0);
       return(__FUNCSIG__);
      }
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
      {
       int i;
       bool b;
       Print(Assign(i,"test"));
       Print(Assign(b,"test"));
      }
    As a result of the code execution, we can see that the Assign() template function has been used for the int+string pair, while the overloaded version has already been used for the bool+string pair during the second call.
    string Assign<int,string>(int&,string)
    string Assign(bool&,string)

  2. Added explicit specialization of template functions. To do this, specify typification parameters before the list of the call parameters:
    template<typename T>
    T Func() { return (T)0; }
      
      
    void OnInit()
      {
       Func<double>();   // explicit template function specialization
      }
    Thus, typification is performed by explicit specification of types rather than via the call parameters.

  3. Optimized display of custom indicators with the DRAW_ZIGZAG drawing type.
  4. Added the new values to the ENUM_DEAL_TYPE deal types enumeration:

    • DEAL_DIVIDEND — dividend operations.
    • DEAL_DIVIDEND_FRANKED — franked (non-taxable) dividend operations (tax is paid by a company, not a client).
    • DEAL_TAX — charging a tax.

  5. Fixed display of custom indicators with the DRAW_FILLING drawing type. In case the upper and lower line coordinates coincide, a thin line is drawn.
  6. Fixed calculating the Bitmap Label object coordinates when setting the CHART_SHOW parameter to 'false'. The parameter is set by the ChartSetInteger function and allows hiding all price chart elements to create a custom program interface.
  7. Fixed re-encoding of 24-bit images when placing them to MQL5 application resources.
  8. Fixed printing structures using the ArrayPrint function.
  9. Updated the MQL5 standard libraries.

MetaEditor

  1. Added translation of the user interface into Malay.

Signals

  1. Signals: Fixed opening a signal page in the terminal when moving from the MQL5.community website while not connected to a trading account.

Tester

  1. Fixed the CopyTicks function operation in the strategy tester.
  2. Fixed sorting Withdrawal trades when generating a report.
  3. Fixed modifying pending orders.

Hosting

  1. Hosting: Fixed display of the virtual hosting wizard on ultra-high resolution screens (4К).

Updated documentation.