New MetaTrader 5 Platform Build 1570: Improved Market showcase and extended MQL5 template functions

 

New MetaTrader 5 Platform Build 1570: Improved Market showcase and extended MQL5 template functions

MetaTrader 5 platform update is to be released on March 24, 2017. The update will feature the following changes:

  1. Terminal: 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. Terminal: 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. Terminal: Fixed occasional incorrect sorting of position history.
  4. Terminal: Optimized and fixed display of the Exposure tab.
  5. MQL5: 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)

  6. MQL5: 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.

  7. MQL5: Optimized display of custom indicators with the DRAW_ZIGZAG drawing type.
  8. MQL5: 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.

  9. MQL5: 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.
  10. MQL5: 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.
  11. MQL5: Fixed re-encoding of 24-bit images when placing them to MQL5 application resources.
  12. MQL5: Fixed printing structures using the ArrayPrint function.
  13. MQL5: Updated the MQL5 standard libraries.
  14. MetaEditor: Added translation of the user interface into Malay.
  15. Signals: Fixed opening a signal page in the terminal when moving from the MQL5.community website while not connected to a trading account.
  16. Tester: Fixed the CopyTicks function operation in the strategy tester.
  17. Tester: Fixed sorting Withdrawal trades when generating a report.
  18. Tester: Fixed modifying pending orders.
  19. Hosting: Fixed display of the virtual hosting wizard on ultra-high resolution screens (4К).
  20. Updated documentation.

The update will be available through the LiveUpdate system.

 

I'm seeing an issue with Strategy tester whilst trying to test Expert advisors. All input variables are missing from the "Inputs" Tab

I'm about to raise this with the service desk. Is anyone else experiencing this issue ?


#property strict

extern string          TestInputStr1 = "test";    // Test Input String 1
extern int             TestInputInt1 = 1;         // Test Input Int 1
extern int             TestInputInt2 = 2;         // Test Input Int 2
extern int             TestInputInt2 = 3;         // Test Input Int 3

void OnTick()
{
}
 
This situation that I expose in this link(https://www.mql5.com/en/forum/188384), originated from this update?
Since when the external variables do not work?
Since when the external variables do not work?
  • www.mql5.com
Hello everyone, Less than 40 days ago I made an indicator, in mql5 and inside the input parameters I can put external variables (extern int, extern...
 
Andres.riosp:
This situation that I expose in this link(https://www.mql5.com/en/forum/188384), originated from this update?

Thanks,

So the workaround is to only use input variables and copy them to globals if you need to modify them.

Did you report it to the service desk?

 
James Cater:

Thanks,

So the workaround is to only use input variables and copy them to globals if you need to modify them.

Did you report it to the service desk?

Extern in mql5 has an other meaning than in mql4 (as explained by Amir in other thread). I don't think there is something to report to ServiceDesk, always be like that.
 
Alain Verleyen:
Extern in mql5 has an other meaning than in mql4 (as explained by Amir in other thread). I don't think there is something to report to ServiceDesk, always be like that.

Well something has changed, because externs worked just fine until just recently.

However I'm happy to use inputs, it's easy enough to copy them to globals if they need modifying

 
James Cater:

Well something has changed, because externs worked just fine until just recently.

However I'm happy to use inputs, it's easy enough to copy them to globals if they need modifying

Ah ok. I never tried to use them as input so I didn't notice it. Seems they fixed an old bug :-D
 
James Cater:

Gracias,

Así que la solución es utilizar solamente las variables de entrada y copiarlos en un Globals si es necesario modificarlos.

Lo denunció a la mesa de servicio?


Exactly, it is the only thing that changes, that you must use the "input" and then pass its value a global variable in case you need to modify

Thank you all for replying!!!
Reason: