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
182658
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
182658
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.

1...1112131415161718
To add comments, please log in or register