Download MetaTrader 5

List of changes in MetaTrader 5 Client Terminal builds - page 18

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
192448
MetaQuotes Software Corp.  

New MetaTrader 5 Platform Build 1495: Improvements in MQL5 for working with custom graphics

MetaTrader 5 platform update is to be released on December 9, 2016. It contains the following changes:

  1. MQL5: Added the CopyTicksRange function.
  2. MQL5: Added improved anti-aliasing functions to CCanvas class:
  3. MQL5: Added description of the graphical library to the MQL5 Reference. The library allows to quickly create histograms, distributions and line graphs right on the price charts.
  4. MQL5: Added the identifiers of the state of system keys to the list of constants of Client Terminal Properties. A call to TerminalInfoInteger(TERMINAL_KEYSTATE_XXX) returns the same state code of a key as the GetKeyState() function in MSDN.
  5. MQL5: Disabled the support for casting of string type to bool. To check strings, one needs to use explicit conditions. For example, in the new build, compilation of the following code will result in an error:
    string str;
    ...
    if(str)                        // will result in "Cannot convert type 'string' to 'bool'" compilation error (no error would appear in the previous versions)
       Print("str is true");
    One should use an explicit condition:
    string str;
    ...
    
    //--- check if the string is initialized
    if(str!=NULL)
       Print("str is true");
    
    or
    
    //--- check if the string value is "true"
    if(StringCompare(str,"true",false))
       Print("str is true");
    
    or
    
    //--- check if the string is integer and is not equal to zero
    if((int)str!=0)
       Print("str is true");
  6. Fixed errors reported in crash logs.

The update will be available through the LiveUpdate system.
MetaQuotes Software Corp.
Moderator
192448
MetaQuotes Software Corp.  

New MetaTrader 5 build 1525: Representing trading history as positions and tester improvements

The MetaTrader 5 platform update will be released on Friday, January 27, 2017. The new version features the following changes:

  1. Terminal: Now trading history can be additionally displayed in the form of positions. The terminal collects data on deals related to a position (position opening, additional volume, partial and full closure), and then combines the data into one record providing the following details:

    • Position opening and closing time determined by the first and last trade respectively
    • Position volume. If part of the position has been closed, the record contains the closed volume and the initial volume
    • The weighted average position opening price and its close price
    • The total financial result of deals related to the position




    On hedging accounts, the new history form is similar to the account history used in MetaTrader 4.




  2. Terminal:  A new command has been added, which allows visualizing trades on a symbol's chart.

    • If you need to show deals of a selected position/symbol, click "Add [symbol name] Deals". Appropriate deals will be displayed on all currently open charts of the selected symbol. If there are no open charts of that symbol, a new chart will be opened.
    • Click "Add All Deals" in order to show deals of all symbols from the account history. Appropriate deals of corresponding symbols will be added to all open charts.




  3. Terminal: Added display of the international name of a trading instrument in contract specification, as well as search by the international name in symbol management dialog.




  4. Terminal: Added command for terminal window resolution setup. The function will be helpful for making videos. The menu provides the most popular resolution options used in various video services, such as YouTube.



  5. Terminal: Chart templates and profiles have been moved from [Terminal Data Folder\Profiles] to [Terminal Data Folder\MQL5\Profiles]. Now you can easily add templates to the MQL5 Storage and access them from any PC.
  6. MQL5: Added support for resource variables. Development of some programs can be greatly facilitated by using such variables. For example, you can write a code of an OpenCL program in a separate CL file and then include it as a string into your MQL5 program resources. Before the update, such a code needed to be described as one large string variable.

    Declaration of the resource variable
    #resource path_to_resource_file as type_of_resource_variable name_of_resource_variable

    Features
    • Encoding of string files is determined automatically based on the BOM (the header). If BOM is absent, encoding is defined by the file contents. ANSI, UTF-8 and UTF-16 are supported. All strings are converted to Unicode.
    • Data of such a resource can only be addressed via a variable. Automatic addressing using "::<resource name>" is not available.
    • The special bitmap resource variable type shows to the compiler that the resource is an image. In this case, the resource variable gets the uint type.
    • When using a 24-bit image, the alpha channel component is set to 255 for all the image pixels.
    • When using a 32-bit image without the alpha channel, the alpha channel component is also set to 255 for all the image pixels.
    • When loading a 32-bit image with the alpha channel, the pixels are not processed in any way.
    • The bitmap type array resource variable may have two dimensions. In this case, the array size is defined as [image_height ][ image_width ].
    • If an array of one dimension is specified, the number of elements is equal to image_height*image_width.
    • If the resource file size is not a multiple of the array element size, the remaining data will be cropped. For example, if file size is 14 bytes, the number of elements for an int array will be equal to 3, while the other 2 bytes (14 - sizeof(int)*3) will be discarded.

    Examples of Use
    #resource "data.bin" as int ExtData[]             // declaring the numeric array containing data from the data.bin file
    #resource "data.bin" as MqlRates ExtData[]        // declaring the simple structures array containing data from the data.bin file
    
    #resource "data.txt" as string ExtCode            // declaring the string containing the data.txt file data
    #resource "data.txt" as string ExtCode[]          // declaring the string array containing the data.txt file data
    
    #resource "image.bmp" as bitmap ExtBitmap[]       // declaring the one-dimensional array containing a bitmap from the BMP file, array size = width * height
    #resource "image.bmp" as bitmap ExtBitmap2[][]    // declaring the two-dimensional array containing a bitmap from the BMP file, array size [hight][width]
    

  7. MQL5: New property CHART_SHOW allows disabling chart display. Functions ChartGetInteger and ChartSetInteger are used to get and set the property.

    If false, drawing of any price chart attributes is disabled and all chart border indents are eliminated, including time and price scales, quick navigation bar, Calendar event labels, trade labels, indicator and bar tooltips, indicator subwindows, volume histograms, etc.

    Disabling the drawing is a perfect solution for creating a custom program interface using graphical resources.

    The graphical objects are always drawn regardless of the CHART_SHOW property value.

  8. MQL5: New property CHART_KEYBOARD_CONTROL allows enabling/disabling chart control using the keyboard ("Home", "End", "PageUp", "+", "-", "Up arrow", etc.). Setting CHART_KEYBOARD_CONTROL to false disables chart scrolling and scaling while leaving intact the ability to receive the keys pressing events in OnChartEvent().

    Functions ChartGetInteger and ChartSetInteger allow getting and setting the property.

  9. MQL5: Added new functions for working with OpenCL.

    New properties for working with memory
    Four new properties can be received through CLGetInfoIntegrer:
    • CL_DEVICE_MAX_WORK_GROUP_SIZE — the total number of local working groups available for an OpenCL device.
    • CL_KERNEL_WORK_GROUP_SIZE — the total number of local working groups available for an OpenCL program.
    • CL_KERNEL_LOCAL_MEM_SIZE — size of the local memory in bytes used by an OpenCL program for solving all parallel tasks in a group. Use CL_DEVICE_LOCAL_MEM_SIZE to receive the maximum available value.
    • CL_KERNEL_PRIVATE_MEM_SIZE — the minimum size of the private memory (in bytes) used by each task in the OpenCL program kernel.

    bool CLExecutionStatus(int kernel)
    Returns the OpenCL program execution status. The OpenCL program kernel handle is passed as the parameter.

    bool CLSetKernelArgMemLocal(int kernel_handle,int arg_index,ulong local_mem_size)
    Sets the local buffer as an argument of the kernel function. The OpenCL program kernel handle, the number of the OpenCL function argument and the buffer size are passed as parameters.

  10. MQL5: Added TranslateKey function that returns a Unicode character by a virtual key code considering the current input language and the status of control keys. The function uses ToUnicodeEx to convert keys pressed by a user into Unicode characters.
    void OnChartEvent(const int id,const long& lparam,const double& dparam,const string& sparam)
      {
       if(id==CHARTEVENT_KEYDOWN)
         {
          short sym=TranslateKey((int)lparam);
          //--- if the entered character is successfully converted to Unicode
          if(sym>0)
             Print(sym,"'",ShortToString(sym),"'");
          else
             Print("Error in TranslateKey for key=",lparam);
         }
      }

  11. MQL5: New response code TRADE_RETCODE_LIMIT_POSITIONS has been added. The number of open positions simultaneously present on an account can be limited by the server settings. After a limit is reached, the server returns the TRADE_RETCODE_LIMIT_POSITIONS error when attempting to place an order. The limitation operates differently depending on the position accounting type:

    • Netting — number of open positions is considered. When a limit is reached, the platform disables placing new orders whose execution may increase the number of open positions. In fact, the platform allows placing orders only for the symbols that already have open positions. The current pending orders are not considered since their execution may lead to changes in the current positions but it cannot increase their number.
    • Hedging — pending orders are considered together with open positions, since a pending order activation always leads to opening a new position. When a limit is reached, the platform disables placing both new market orders for opening positions and pending orders.

  12. MQL5: Fixed error that could occasionally cause skipping of ticks in the tick history.
  13. MQL5: Fixed indirect template typing errors.
  14. MQL5: Updated library of mathematical statistics functions.
  15. Market: Fixed product page opening when downloading a demo version.
  16. Tester: After optimization completion, results are now automatically sorted by the "Results" column.
  17. Tester: A new command in the context menu of the optimization results tab allows to automatically open results when the optimization completes.
  18. Tester: The Strategy Tester now stays in the optimization mode after starting a single testing run. In earlier versions, if a single test was started from the optimization results tab, the strategy tester switched to the single testing mode. The optimization mode needed to be enabled in the settings in order to perform further optimization.
  19. Tester: Now sets of input parameters can be saved as local strategy tester settings, which can be conveniently accessed from the context menu, in addition to traditional .set files.



  20. Tester: Added UI translations into Mongolian, Hungarian, Romanian and Urdu.
  21. MetaEditor: Added ability to change the order of watched expressions in the debugger window. An expression can be dragged to the required position using the mouse.




  22. MetaEditor: Fixed determining of source file encoding.
  23. MetaEditor: Fixed search by files in the UTF-8 encoding.
  24. MetaEditor: Fixed text selection with a mouse in case the text contains tabs.
  25. MetaEditor: Added UI translations into Hungarian and Romanian.
  26. Updated documentation.

The update will be available through the LiveUpdate system.

Alain Verleyen
Moderator
35042
Alain Verleyen  

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 Platform Build 1545: Fast switching between windows and changing price values with the mouse wheel

MetaQuotes Software Corp., 2017.02.15 16:39

New MetaTrader 5 Platform Build 1545: Fast switching between windows and changing price values with the mouse wheel

The MetaTrader 5 platform update will be released on February 17, 2017. The update will feature the following changes:

  1. Terminal: Fast switch between the 'Toolbox' and 'Strategy Tester' windows.



  2. Terminal: New option allows editing prices and volumes of orders using the mouse wheel:




  3. Terminal: Now, when you go to download mobile terminals, the list of your trade servers is remembered. Then, when you install MetaTrader on your iPhone or Android device, a ready list of servers will be shown to you. You can quickly connect to your existing trading accounts. The server of the currently connected account will be displayed first in the mobile terminal.




  4. Terminal: Significantly reduced load on the terminal, created by invisible (minimized) charts and objects.
  5. Terminal: Fixed occasional incorrect triggering of trailing stop levels.
  6. Terminal: Fixed filtering of trades by symbol in the account trading history.
  7. Terminal: Fixed display of the 'Type' field in the history of positions.
  8. Terminal: Fixed presentation of the trading history in the form of positions.
  9. MQL5: Fixed display of custom indicators whose drawing type is DRAW_COLOR_LINE, DRAW_COLOR_ZIGZAG and DRAW_COLOR_SECTION, in case CLR_NONE is used for the color.
  10. MQL5: Fixed template typing using a constant pointer.
  11. MQL5: Fixed control of access to private and protected class members.
  12. Tester: Fixed activation of limit orders on Exchange instruments, when the order trigger price is worse than the current market (the Buy price is higher than or the Sell price is lower than the market price).
  13. Tester: Removed restriction connected with testing of custom indicators having more than 64 input parameters.
  14. Tester: Added UI translation into Hindi.
  15. Updated documentation.

The update will be available through the LiveUpdate system.


Alain Verleyen
Moderator
35042
Alain Verleyen  

Forum on trading, automated trading systems and testing trading strategies

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

MetaQuotes Software Corp., 2017.03.22 17:03

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.


Alain Verleyen
Moderator
35042
Alain Verleyen  

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 Platform Build 1595: Access to the price history

MetaQuotes Software Corp., 2017.04.19 17:10

New MetaTrader 5 Platform Build 1595: Access to the price history

The MetaTrader 5 platform update will be released on April 21, 2017. The update will feature the following changes:

  1. Terminal: Added access to the bar and tick history. Now, it is possible to download the full 1-minute and tick history from the server through the trading platform interface, not only using the MQL5 language. Access to price data is expanded as part of preparations for the launch of custom data-feed functions. In the near future, the platform will provide the possibility to build charts based on users' price data, as well as to create synthetic symbols and use offline charts.

    To download the data, open the symbol management dialog from the context menu of the "Market Watch" window:


    The dialog features two new tabs: "Bars" and "Ticks". Select the symbol, the desired time interval and click "Request". The platform will request from the server all available data, and will immediately display the data if they have already been downloaded. Saved price data can be exported to a CSV file.

  2. Terminal: Added display of time with a millisecond precision for positions, deals and orders.




  3. Terminal: In the trade dialog, fixed notifying about the refusal to execute a Close By request.
  4. MQL5: Fixed the PositionSelect function. The function could occasionally select a position different from the one having the lowest ticket number.
  5. MQL5: Fixed operation of the CopyTicks and CopyTicksRange functions when requesting very deep tick history data.
  6. Signals: Fixed copying of operations that increase the size of an existing position. The error could occasionally occur on netting accounts.
  7. Tester: Fixed processing of limit orders for exchange instruments. Orders placed better than the market (the buy price is below the market price or the sell price is above that) are executed without slippage. Orders placed worse than the market or at the market price are executed immediately at the market price as of the order placing time.
  8. Updated documentation.

The update will be available through the LiveUpdate system.


To add comments, please log in or register