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.

 
In this thread you can discuss this build.
 

This just came two years late when I need to manage every trade as an individual position NOT combine deals.

I'm just too lazy to port to MT5. 

 
I can answer just this - "Better late than never"
 
No sign of functionality to import external tick data. That's a pity. MT5 could become a professional trading platform.
 

FYI, I cannot run MT5 anymore under Linux with wine. I get this message "a debugger has been found running in your system. Please, unload it from memory and restart your program."

I don't use a debugger. 

 
Camille Huot:

FYI, I cannot run MT5 anymore under Linux with wine. I get this message "a debugger has been found running in your system. Please, unload it from memory and restart your program."

I don't use a debugger. 

This message?


There is thread in russian part of the forum - this thread, and you can read it using in-build online translator which is located above every post there (you can select your language for example):


So, they found the decision to fix it: they found this small article and followed all the steps and everything was fixed.
If you can not fix so make a post to this russian thread and users of rus part of the forum will help I hope.

WineHQ - MetaTrader 5.x
  • appdb.winehq.org
Metatrader 5 32bit (build 1525 27. Jan 2017) The following is working: Clean wine installation with clean "$HOME/.wine32"-prefix was used. In order to get the latest wine 2.0 (staging) binary for LINUX MINT (Ubuntu) I had to add the winehq repository: sudo add-apt-repository ppa:wine/wine-builds Only gecko and mono were automatically...
 
Sergey Golubev:

This message?


There is thread in russian part of the forum - this thread, and you can read it using in-build online translator which is located above every post there (you can select your language for example):


So, they found the decision to fix it: they found this small article and followed all the steps and everything was fixed.
If you can not fix so make a post to this russian thread and users of rus part of the forum will help I hope.

Thank you!

Indeed the solution is to run metatrader with the 32-bit libs (wine32). 

 
Create a chart object on a chart that shows date and price scale.

Try to disable date and price scale of the chart object either via the object properties dialog

or through 'ObjectSetInteger' commands, both will not work.
 
timkrug:
Create a chart object on a chart that shows date and price scale.

Try to disable date and price scale of the chart object either via the properties dialog

or through 'ObjectSetInteger' commands, both will not work.
You should write to service desk.
 
when will be possibile to test / use ex4 on metatrader 5?
Reason: