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

 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 platform build 2615: Fundamental analysis and complex criteria in the Strategy Tester

MetaQuotes, 2020.09.10 17:03

The updated version of the MetaTrader 5 platform will be released on Thursday, September 17, 2020. The new version features the following changes:

  1. Terminal: Expanded fundamental analysis facilities.

    Added new trading instrument properties, which enable a more accurate categorization of symbols:

    • Sector — the sector of the economy which the asset belongs to, such as energy, finance, healthcare and others.
    • Industry — the industry type which the asset belongs to, such as sportswear, accessories, car manufacturing, restaurant business and others.
    • Country — the country of the company whose shares are traded on the stock exchange.

    Based on these properties, a separate system has been implemented in Market Watch, enabling efficient operations with symbols. Select a category from the menu, and all available instruments will be added to a list for in-depth analysis:



    Relevant properties have been added to contract specifications:



    Furthermore, fundamental data on trading symbols can now be opened directly from the platform. Links to the largest aggregators have been added to the Market Watch context menu:



    The availability of extended data is controlled by the broker. However, we have ensured the default availability of the advanced information for the maximum number of instruments. As soon as brokers update their servers to the new version, the appropriate country, sector and industry data will appear in your platforms.
  2. Terminal: Improved Signals and Market showcases. Rental and subscription buttons have been added to the left-side panel:



    Further improvements concern the section design. This includes brighter button colors, larger MQL5 login buttons and other improvements.

  3. Terminal: Fixed potential profit/loss calculation for Stop Loss and Take Profit chart levels.



  4. Terminal: Fixed errors in the calculation of synthetic instruments. The errors could occasionally cause the platform to freeze at startup.
  5. Terminal: Fixed display of built-in Fractals indicator values in the Data Window.
  6. Terminal: All icons in the platform toolbars have been updated to support HiDPI monitors.
  7. Terminal: Fixed position volume adjustment for copied trading signals. The adjustment operation could sometimes fail due to incorrectly applied stop levels, which caused the "invalid stops" error.
  8. Terminal: Optimized price history rebuilding after relevant changes on the server.
  9. Terminal: Fixed display of trade level tooltips on charts. In some cases, tooltips were shown on charts even if the display of trade levels was disabled.
  10. Terminal: Fixed option "Show on Charts \ Auto Update" in the context menu of orders an d positions under the "Toolbox\ Trade" section. Now, if this option is unchecked, trading history display will be disabled for all open charts.
  11. MQL5: Added MathClassify function. It determines the type of a real number and returns a result as a value from the new ENUM_FP_CLASS enumeration.
    ENUM_FP_CLASS  MathClassify(
       double  value      // real number
       );
    The enumeration contains the following values:

    • FP_SUBNORMAL — a subnormal number which is closer to zero than the smallest representable normal number DBL_MIN — 2.2250738585072014e-308.
    • FP_NORMAL — a normal number in the range between 2.2250738585072014e-308 and 1.7976931348623158e+308.
    • FP_ZERO — a positive or a negative zero.
    • FP_INFINITE — a number which cannot be represented by the appropriate type, positive or negative infinity.
    • FP_NAN is not a number.

    Use the following code to check the real number validity:
    if(MathClassify(value)>FP_ZERO)
      {
       Print("value is not a valid number");
      }
  12. MQL5: Added symbol properties which can be obtained using SymbolInfoString functions:

    • SYMBOL_COUNTRY — the country of the company whose shares are traded on the stock exchange.
    • SYMBOL_SECTOR_NAME — the sector of the economy which the asset belongs to, such as energy, finance, healthcare and others.
    • SYMBOL_INDUSTRY_NAME — the industry which the asset belongs to, such as sportswear, accessories, car manufacturing, restaurant business and others.

    The properties are returned as a string.

    The sector and the industry which the instrument belongs to can be obtained as an enumeration value. This can be done by requesting the following properties using the SymbolInfoInteger function:

    • SYMBOL_SECTOR
    • SYMBOL_INDUSTRY

    The ENUM_SYMBOL_SECTOR and ENUM_SYMBOL_INDUSTRY enumerations have been added for working with these properties.

  13. MQL5: A new memory management mechanism has been implemented in MQL5 programs. It enables up to 3 times faster memory allocation and avoids potential memory access errors.
  14. MQL5: Optimized and accelerated operations with the account tick history via History* functions.
  15. MQL5: Fixed WebRequest call from the OnDeinit entry point. In earlier versions, the function call could not be implemented in the case of an Expert Advisor stop.
  16. MQL5: Fixed WebRequest function calls from services. Previously, a function call could fail after service restart.
  17. MQL5: Added check for double type support on a device when using OpenCL. The float type cannot be used in financial calculations due to excessive rounding. Therefore, the platform explicitly requires double-support for calculations. If the double type is not supported, an appropriate message will be written to the platform log: device '<name>' does not support type 'double'. Previously, a common error message was shown in such cases.
  18. MQL5: Significantly accelerated execution of the AccountInfoDouble function with the ACCOUNT_EQUITY and ACCOUNT_BALANCE parameters.
  19. MQL5: Fixed application of templates to a chart through the ChartApplyTemplate function.
  20. MQL5: Fixed ChartSetInteger function call with the CHART_BRING_TO_TOP parameter.
  21. MQL5: A new Conjugate method has been added to the built-in Alglib library. This method enables conjugate number calculation for complex numbers. The library is located at MQL5\Include\Math\Alglib.
  22. MQL5: Completely revised code profiler. The new profiler operates with a higher accuracy and at a higher speed.

    • The analysis is now based on the code which is optimized similarly to the compilation of a program's release version. This enables a more accurate determination of code execution speed, as exactly the same code will be used during program execution.
    • The new profiler uses the "Sampling" profiling method. This lightweight and accurate method collects application performance statistics by collecting call stack data and by calculating performance at regular intervals.
    • Unlike the previous versions, the new profiler does not make any changes to the analyzed code. The previously used Instrumentation method added certain constructs to the code, which were used to measure the function speed. This could affect the final code speed.

    The development of the profiler will continue. Further improvements will become available in upcoming platform releases.

  23. Tester: Optimized operations with MQL5 Cloud Network. Fixed loading of Expert Advisors on agents.
  24. Tester: Added new optimization criterion "Complex Criterion max". This is an integral and complex measure of a test pass quality. It measures multiple parameters:

    • Number of Deals
    • Drawdown
    • Recovery Factor
    • Expected Payoff
    • Sharpe Ratio

    The highest value of one parameter (for example the profit) is not always the best option in terms of the complex analysis. The complex criterion gradually selects the best passes: firstly, by the number of deals, then by the Expected Payoff, Recovery Factor, and so on. The new option allows reception of the best optimization passes according to all parameters. Furthermore, you can select the optimal pass based on the desired parameter, such as the highest profit.

    Select the new criterion in the strategy tester settings and start optimization.



    The "Complex Criterion max" value will be displayed in a separate "Result" tab in optimization results. Passes can be sorted by this column. The new criterion supports color-coded lighting to visually highlight the best passes. Values below 20 are highlighted in red, and values above 80 are shown in dark green.



  25. Tester: Fixed calculation of custom commissions in the Strategy Tester.
  26. MetaEditor: We have initiated the global revision of smart code management functions (IntelliSense).

    • Hints now show the full function signature in addition to its name.
    • The font for the hints is now set in accordance with MetaEditor settings.

    Further improvements will become available in upcoming platform releases.

  27. Updated documentation.

The update will be available through the Live Update system.

 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 platform build 2650: Background chart loading and MQL5 code profiler improvements

MetaQuotes, 2020.10.08 16:39

The MetaTrader 5 platform update will be released on Friday, October 9, 2020. The new version features the following changes:


  1. Terminal: The Options tab features a new setting entitled "Preload chart data for open positions and orders".

    In order to save traffic, the trading platform downloads symbol price history only when the relevant data is requested, for example, when the price chart is opened or when testing is launched. However, this may not always be convenient for actively used symbols. If you enable the new option, the charts of the symbols for which you have open positions or pending orders, will be updated in the background mode whenever you launch the platform. Thus, you will not have to wait for data download after chart opening. The relevant data will be immediately available for analysis.




  2. Terminal: Fixed generation of daily bars after weekends.
  3. Terminal: Fixed chart updating. Charts could occasionally fail to update after the additional download of updated price data.
  4. Terminal: Optimized updating of the account trading history cache. The optimization enables the reduction of data delays when using History* functions.
  5. Terminal: Fixed display of the Comment column when displaying trading history as positions.
  6. Terminal: Fixed display of the Signal subscription renewal button.
  7. MQL5: More improvements within the total update of the code profiler. The following functions have been implemented in addition to the innovations presented in build 2615:

    Added new parameters
    We have previously announced the usage of the Sampling method for the new profiler. The profiler makes pauses in the MQL program operation (~1000 times per second) and collects statistics on how many pauses were performed in certain code segments. This also includes the analysis of call stacks to determine the share of each function in the total code operation time. After profiling, users receive statistics on how many times the operation was paused and how many times each of the functions appeared in the call stack:

    • Total CPU [unit,%] — how many times the function appeared in the call stack.
    • Self CPU [unit,%] — the number of "pauses" which occurred directly within the specified function. This variable is crucial in identifying bottlenecks: according to statistics, pauses are more frequent when extra processor time is required.


    Added ability to disable function inlining during profiling
    During the compilation of MQL programs, functions are inlined, i.e. the function code is added directly to the function call site. This enables significant performance acceleration. However, this procedure makes the profiling of functions difficult. In order to obtain a report on "pure" functions, you can disable inlining in the MetaEditor settings:




    Updated report design
    We have redesigned the profiling report and the presentation of profiling information in the source code window. The modernized design will be more familiar to Visual Studio users.




  8. MQL5: Fixed CopyTicksRange function operation. The function could sometimes return incomplete data.
  9. MQL5: New error code TRADE_RETCODE_HEDGE_PROHIBITED — opening of a position or placing of a pending order is not allowed because hedge positions are prohibited. The error is returned if a user tries to execute a trading operation in the case the hedging is disabled for the account, and the user already has an opposite order or position for the same symbol.
  10. MQL5: Removed the ability to call MessageBox when debugging indicators. MessageBox cannot be called from indicators because it suspends the thread execution for the whole time, while waiting for the user's response.
  11. MQL5: Optimized and significantly accelerated addition of trading instruments to the Market Watch using the SymbolSelect function.
  12. MQL5: Fixed ArrayInsert function behavior for fixed-sized arrays. Now, the behavior corresponds to its description in the documentation: when elements are inserted, the size of the destination array does not change and the elements to the right of the insert position are shifted to the right (the last 'count' elements are "dropped off"), while the elements are copied from the source to the released space.
  13. Tester: Fixed working with custom trading condition settings during testing; the settings dialog has been revised.

    • Fixed calculation of custom commissions. To enable commissions, it is now enough to specify the symbol name rather than the entire path.
    • Rearranged tabs for more efficient operation.
    • Renamed the dialog and the option enabling custom settings.
    • Optimized column width in the settings tables.
    • When the "Use custom settings" option is disabled, all other settings in the dialog are deactivated. Previously, the settings remained editable, and users could have mistakenly thought that the settings would be applied during testing.




  14. Tester: Fixed an occasional error related with the receiving of orders from the trade history by ticket.
  15. MetaEditor: Added color scheme presets for the code editing window: light (default), dark and blue. You can customize the editor without having to configure the editor view manually.

    Additionally, it is now possible to customize the border color for the function tooltips.



     
  16. MetaEditor: All icons in the toolbars have been updated to support HiDPI monitors.
  17. Documentation has been updated.

The update will be available through the Live Update system.

 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 Platform Build 2690: MetaEditor improvements

MetaQuotes, 2020.11.11 17:02

The updated version of the MetaTrader 5 platform will be released on Thursday, November 12, 2020. The new version features the following changes:


  1. Terminal: Fixed display of the synthetic Market Depth feature. Previously, this feature could be unavailable for some symbols.

    Synthetic Market Depth is used for the symbols, for which Level 2 prices are not provided. In this case, levels are built automatically, at distances equal to a price change step, starting from the best Bid and Ask prices. This is a convenient tool for placing, modifying and deleting orders, quickly and with maximum clarity.




  2. MQL5: Optimized and greatly accelerated access to Last prices from MQL5 programs, using the SymbolInfoTick function.
  3. MQL5: Fixed resetting of Ichimoku Kinko Hyo indicator parameters from a dialog box.




  4. MQL5: Fixed freezing of Copy* functions when history is not available for a trading instrument.
  5. MQL5: More improvements within the total update of the code profiler. The following improvements have been implemented, in addition to the innovations presented in build 2650:

    • Improved data presentation
    • Shorter column names are now used in the report
    • Ability to save profiling reports to a file
    • Added display of a tooltip with a row number for functions in the report.




  6. MetaEditor: Added ability to disable clipboard tracking and to clear clipboard history.

    The clipboard tracking function improves the source code usability by providing quick access to recently used data. Press Alt+V in any source code position, select any of the earlier copied lines from the menu, and the line will be inserted in the selected position.

    Use the appropriate toolbar command or editor settings to enable/disable tracking.




  7. MetaEditor: Fixed calculation of some observed expressions during program debugging.
  8. MetaTester: Trading is now prohibited for Expert Advisors running in the Strategy Tester in the frame receiving mode.
  9. MetaTester: Fixed importing of optimization results in the Strategy Tester. An error could cause timeframe values to be imported incorrectly.
  10. Documentation has been updated.


The update will be available through the Live Update system.

 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 platform build 2715: General improvements

MetaQuotes, 2020.11.25 16:56

The updated version of the MetaTrader 5 platform will be released on Thursday, November 26, 2020. The update provides the following changes:

  1. Terminal: Fixed platform freezing when using the options board. Freezing could be caused by a zero tick size specified in trading instrument settings.
  2. Terminal: Fixed UI display errors on HiDPI displays.
  3. MQL5: Fixed string to time conversion by the StringToTime function. An error could occur when specifying time as "yyyymmdd [hhmiss]".
  4. MQL5: Fixed operation of implicit copy operator for objects containing dynamic arrays. Now, the operation reduces the destination object size to the copied object size.
    struct MyStruct
    {
      string Array[];
    };
    
    void OnStart()
    {
      MyStruct a1,a2;
      ArrayResize(a1.Array,3);
      ArrayResize(a2.Array,1);
      a1=a2;
    }
    Earlier, the "a1" array size was equal to 3 after the function call. Now, the size will be 1.

  5. MetaTester: Updated rating calculation algorithm for MQL5 Cloud Network testing agents. The rating is now determined more accurately and is changed less frequently.
  6. Documentation has been updated.

The update will be available through the Live Update system.

 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 Platform build 2755: Popup Prices window and Debugger improvements

MetaQuotes, 2021.01.13 16:49

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


  1. Terminal: Revised Popup Prices window which allows viewing financial symbol prices on any screen size.

    The window now supports multi-column presentation, enabling the efficient utilization of screen space. To switch the display mode, use the window properties dialog.


    Support for multi-column display in the Popup Prices window

    Further improvements in this window are as follows:

    • Added column selection menu. The menu features the same symbol properties which are available in Market Watch.
    • Optimized operation with a large number of financial instruments. The window performance is now equally high for 10 and for 1000 instruments.
    • Added display of brief instrument information in a tooltip.
    • Fixed applying of color settings for displaying rising and falling prices.

  2. Terminal: Added display of deals on the tick chart of the synthetic Market Depth.

    Synthetic Market Depth is used for the symbols, for which Level 2 prices are not provided. In this case, levels are built automatically, at distances equal to a price change step, starting from the best Bid and Ask prices. Now, if the last deal price and volume data is provided for a symbol, the relevant data is displayed on the tick chart. The information is displayed as circles:

    • Red circles show Sell transactions.
    • Blue circles show Buy transactions.
    • Green circles appear when the direction of the transaction is undefined.

    The larger the circle, the greater the volume of the transaction.


    Synthetic Market Depth now shows information about the last deal price and volume


  3. Terminal: Fixed calculation of Greeks in the options board. An error could occur if the option's underlying asset had a zero last deal price.
  4. Terminal: We continue implementing the new "Subscriptions" service, which enables the provision of additional trading services. Recently, we have fixed the display of dependent subscriptions. Such subscriptions are used for bundled services.
  5. Terminal: Improved platform operation under Wine.
  6. MQL5: Added generation of ChartEvent events upon the release of the right and middle mouse buttons. This event can be utilized when creating graphical panels. To enable the events, disable the chart context menu via the CHART_CONTEXT_MENU property.
  7. MQL5: Fixed a bug causing a significant error in the Sleep function waiting time.
  8. MetaEditor: We have initiated the global update of the debugger. The window of observed expressions has been significantly improved. Now, it allows viewing the contents of arrays and objects as drop-down lists, as well as pointer values.


    View the contents of arrays and objects while debugging


    To view an array or object, double-click on it in the observation window.

  9. MetaEditor: Fixed freezing when opening some projects.
  10. Documentation has been updated.

The update will be available through the Live Update system.

 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 Platform build 2815: Access to the Depth of Market from Python, revamped Debugger, and Profiler improvements

MetaQuotes, 2021.02.25 17:28

The MetaTrader 5 platform update will be released on Friday, February the 26th, 2021. The new version features the following changes:

  1. Terminal: Added ability to access Depth of Market data via the Python API.

    Three new functions allow quick obtaining of data for statistical calculations and machine learning tasks, which can be implemented using a plethora of out-of-the-box Python libraries.

    • market_book_add — subscribes the MetaTrader 5 terminal to receive events related to changes in the Depth of Market for the specified symbol.
    • market_book_get — returns a tuple from BookInfo containing the Depth of Market records for the specified symbol.
    • market_book_release — cancels MetaTrader 5 terminal subscription to events related to changes in the Depth of Market for the specified symbol.

  2. Terminal: The maximum length of Push messages has been increased from 256 to 1024 characters. Now, you can send more information from your MQL5 programs on mobile devices.
  3. Terminal: Added a preliminary version of the Task Manager, which can be called by pressing the F2 key.

    The Task Manager enables monitoring of resources consumed by the platform. You can view the amount of memory consumed by charts, CPU resources used by Expert Advisors and other performance metrics. If your platform performance slows down, you can easily detect and fix the problem.


    Use the Task Manager to control the resources consumed by the platform


  4. Terminal: Enhanced Subscriptions service. A special indication has been added for symbols having delayed quotes:

    • Symbols in Market Watch are marked with a clock icon, and the delay value is displayed in the tooltip
    • Data delay notification is displayed on charts


    Symbols with delayed quotes are marked with a special indication


  5. Terminal: Fixed display of the Subscriptions list when there is no trading account connection.
  6. Terminal: Fixed links in emails and newsletters. All links now open in the default browser. Previously, links opened only in Internet Explorer.
  7. Terminal: Fixed connections from the WebRequest function to hosts with IPv6 addresses and Cloudflare protection.
  8. Terminal: Improved functionality and responsiveness of the VPS service.
  9. Terminal: Improved operation under Wine and MacOS/Crossover, including the version for macOS Big Sur with the M1 processor.
  10. MQL5: Fixed error in the ArrayPrint function. The function could occasionally fail to print arrays.
  11. MQL5: Optimized file operations performed by File* functions. Now, file reading and writing operations run much faster.
  12. MQL5: Removed the restriction requiring the specification of size for the second, third and fourth dimensions of a dynamic array, when the array is used as a function parameter. This increases code reuse and flexibility.
    void func(int &arr[ ][ ][ ][ ])
      {
      }
  13. MQL5: Fixed ArrayBsearch function operation. The function could return an incorrect index of the found element during a binary search.
  14. MetaEditor: More new features have become available in the revamped debugger.

    • Arrays are now displayed in the observation window in accordance with the sorting set by ArraySetAsSeries.
    • Added support for local static variables.
    • Fixed display of the specified array element value.
    • Fixed handling of 'static' class fields.
    • Other improvements for more accurate and reliable debugging.

  15. MetaEditor: Added option "Enable optimizations in profiling".

    Code optimization mode can be disabled in order to include more details in the profiling report. Code speed without optimization can be several times slower, but this mode provides a wider code coverage. Please note that with optimization code bottlenecks can be imprecise.

    A milder profiling mode can be set by disabling the "Enable inlining in profiling".


    Added ability to enable and disable code optimization during profiling

    The optimization management option has also been added to project settings.

    • If optimization is disabled in the project, then the new option is ignored, and thus optimization will always be disabled for profiling (including inlining operations).
    • If optimization is enabled in the project, then the new option will be taken into account during profiling compilation.

  16. MetaEditor: Added logging for debugging and profiling processes. Environment settings are logged at operation start; collected data statistics is logged at operation stop.
    MQL5 profiler    starting 'ExpertMACD.ex5' on history with parameters:
    MQL5 profiler       symbol: 'EURUSD'
    MQL5 profiler       period: 'H1'
    MQL5 profiler       date from: '2021.01.01'
    MQL5 profiler       date to: '2021.02.22'
    MQL5 profiler       ticks mode: 'every tick'
    MQL5 profiler       execution delay: 0 ms
    MQL5 profiler       deposit: 10000
    MQL5 profiler       currency: 'USD'
    MQL5 profiler       leverage: 1:100
    MQL5 profiler       profit in pips: NO
    MQL5 profiler    profile data received (4640 bytes)
    MQL5 profiler    758 total measurements, 0/0 errors, 470 kb of stack memory analyzed
    MQL5 profiler    7782 total function frames found (1929 mql5 code, 342 built-in, 1403 other, 4108 system)
  17. Tester: Fixed specification of non-trading hours in advanced testing settings.
  18. Updated documentation.


The update will be available through the Live Update system.

 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 Platform Build 2860: Improvements for Wine and SQL integration enhancements

MetaQuotes, 2021.03.24 15:50

The MetaTrader 5 platform update will be released on Friday, March the 26th, 2021. The new version features the following changes:

  1. Terminal: Added ability to enable/disable additional MQL5.community services. For example, if you are not interested in MQL5 programming articles or copy trading features of the Signals service, you can disable the relevant section to optimize resources and terminal workspace.


    Disable unused services to save resources and workspace

    All services are enabled by default.

  2. Terminal: We have significantly optimized terminal operation under Wine on macOS and Linux:

    • Now undocked service windows (Navigator, Toolbox) cannot be dragged beyond terminal borders. Previously, this could cause difficulty in dragging windows back to the terminal.
    • Fixed resizing of service window contents when resizing the window.
    • Fixed display of performance metrics in Task Manager.
    • Improved display of icons on the toolbar.
    • Fixed unread message counter in chats.
    • Fixed display of chart system commands: Hide, Expand and Close.
    • Fixed log display.
    • Fixed display of chart tooltips.
    • Fixed chart print commands.
    • Fixed display of the top menu when using Linux skins.
    • Fixed search in GitHub, MSDN and Stack Overflow in MetaEditor.

    We recommend all users to update Wine to the latest stable version. This will increase the platform performance and reliability.
  3. Terminal: Added support for "Market To Limit" orders when trading on BORSA Istanbul. Such an order is initially executed as a market order. If liquidity is not enough, the remaining volume is added to the order book as a limit order with the last deal price.
  4. Terminal: Fixed volatility chart display. Now, the chart is built in accordance with the expiry date selected on the options board.
  5. Terminal: Fixed adding of trading instruments to the Market Depth via the quick search bar. If the symbol name has a space, this symbol will not be added to the list.


    To add an instrument to the Market Watch, type its name in the search bar


  6. MQL5: Expanded possibilities for working with SQL databases. Queries now support a variety of statistical and mathematical functions.

    Statistical functions

    • mode
    • median (50th percentile)
    • percentile_25
    • percentile_75
    • percentile_90
    • percentile_95
    • percentile_99
    • stddev or stddev_samp — sample standard deviation
    • stddev_pop — population standard deviation
    • variance or var_samp — sample variance
    • var_pop — population variance

    Mathematical functions


    Example
    select
      count(*) as book_count,
      cast(avg(parent) as integer) as mean,
      cast(median(parent) as integer) as median,
      mode(parent) as mode,
      percentile_90(parent) as p90,
      percentile_95(parent) as p95,
      percentile_99(parent) as p99
    from moz_bookmarks;
  7. MQL5: Added new macros:

    • __COUNTER__ — increases by one on each call. Separate counters are provided when used in templates and macros.
    • __RANDOM__ — generates a random ulong number; it is an analogue of the MathRand function.

  8. MQL5: Fixed operation of synchronous chart requests in cases when the chart symbol does not exist. Now, the functions return a relevant error instead of waiting indefinitely for a result. A situation with a non-existent symbol be caused by switching between trading accounts with different sets of trading instruments.
  9. MQL5: Optimized and accelerated CopyTicks* functions.
  10. MetaEditor: Changed order of profiling and debugging using historical data.

    Profiling now always runs in non-visual mode. Default debugging also runs in non-visual mode. The appropriate option can be enabled manually in MetaEditor settings:


    For visual debugging enable the appropriate option in MetaEditor settings


  11. MetaEditor: Added ability to profile services. The process is similar to other MQL5 programs.
  12. MetaEditor: Fixed display of function names in the profiler report. Under certain conditions, the names could be specified as <unknown>.
  13. Documentation has been updated.

The update will be available through the Live Update system.

 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 Platform build 2875: Improvements and fixes

MetaQuotes, 2021.03.31 16:12

The MetaTrader 5 platform update will be released on Friday, April the 2nd, 2021. The update provides improvements and fixes based on the feedback we have received after the previous MetaTrader 5 build 2860 release:


  1. Terminal: Fixed a bug which caused updated MQL5 standard programs to be copied to the terminal's root data directory instead of the MQL5 subdirectory. Due to this error, additional "Experts", "Images", "Include" and other folders could be created under the data directory.

    After the platform update, these folders will be checked and automatically deleted.

  2. Terminal: Fixed an error which used to prevent users from logging into the built-in MQL5.community chat.
  3. Tester: Fixed optimization of Expert Advisors via the MQL5 Cloud Network. The optimization could fail to start under certain conditions.
  4. MetaEditor: Fixed errors and crashes during MQL5 program debugging and profiling.
  5. Updated documentation.

The update will be available through the Live Update system.

 

Forum on trading, automated trading systems and testing trading strategies

MetaTrader 5 Platform Build 2940: Positioning of MQL5 Services showcases in the workspace and updated design

MetaQuotes, 2021.05.14 10:08

The MetaTrader 5 platform update will be released on Friday, May the 21st, 2021. The new version features the following changes:

  1. Terminal: Trading services, including Market, Signals and Virtual Hosting are now conveniently displayed in the platform's main working area.

    In earlier versions, MQL5 Services purchasing areas were located in the small Toolbox window below the main window. The new placement enables the display of fully featured showcases with convenient purchasing options. The removal of unnecessary tabs from the lower area provides more space for other platform functions.



    MQL5 services are now conveniently arranged in the main working area of the platform

    Access to additional services does not interfere with the major functions, such as trading and chart analysis.

    • Service tabs are located at the end of the bar, after all chart tabs.
    • Unused service windows can be closed. To re-open them, use the Navigator, the toolbar or the "Services" menu.

    We have also completely redesigned the services. The design has become more elegant and lightweight. Signals feature additional data, which were previously available only via the MQL5.community website showcase: a polar diagram with the main characteristics, reliability and activity metrics and other variables.


    Service design has become more lightweight and modern

  2. Terminal: Added support for IPv6 addresses.

    IPv4 which is used in every network was created more than 30 years ago. It contains IP addresses of 32 bits, which are represented as four 8-bit numbers separated by dots. This algorithm produces more than four billion unique IP addresses. However, the rapidly growing number of users and devices has accelerated the depletion of the pool of available addresses.

    To avoid the depletion problem, some products feature additional support for the modern IPv6 standard. This protocol uses a 128-bit address, represented as x:x:x:x:x:x:x:x, where each x is a hexadecimal value of six 16-bit address elements. Theoretically, this format allows 5 x 10 ^ 28 unique addresses. In addition to an extensive address space, this protocol has other advantages over the older version. For further details please refer to specialized articles.

    The MetaTrader 5 platform is fully IPv6-ready. If your broker or provider switches to the new protocol, the protocol support will be seamlessly enabled in the platform, with no additional action required from your end.

  3. Terminal: We continue implementing the Task Manager functionality presented in build 2815. We have added an explicit indication for charts, on which MQL program debugging or profiling is running.


    Debugging and profiling are shown in Task Manager


  4. Terminal: Implemented faster platform launching under Wine on macOS and Linux computers. General optimization and bug fixes:

    • Improved display of menus, toolbars and dialog boxes.
    • Fixed errors in displaying the "Market", "Signals" and "VPS" sections. In particular, we have fixed the loading of product logos on the "Market" showcase.
    • Updated DMG package for easy MetaTrader 5 installation on macOS computers. With this package, the platform can be installed similarly to any other application: drag the platform icon to Applications and wait for the installation to complete.
      The package includes additional components which enable a more stable and a faster operation. All package users are strongly advised to reinstall MetaTrader 5 by downloading the latest version from https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/MetaTrader5.dmg
    If you are using CrossOver, please completely reinstall MetaTrader 5 to obtain the latest 64-bit platform version.
  5. Terminal: Fixed "Ctrl+F9" keyboard shortcut action. It activates the Trade tab in the Toolbox.
  6. MQL5: We continue limiting the circulation of older technologies, including 32-bit components.

    • 32-bit terminals are no longer allowed to load programs from the Market.
    • 32-bit terminals cannot connect to the hosting service.
    • The 32-bit MetaEditor version does not support additional file protection via MQL5 Cloud Protector.
    • MQL5 programs compiled under old MetaEditor versions (released 5 years ago or more) cannot run in the new terminal version.

    Support for the 32-bit platform version was discontinued a year ago, after the release of build 2361. We strongly recommend upgrading to the 64-bit MetaTrader 5 version in order to access all the platform's features without any limitation.
    Furthermore, we recommend all Sellers, who have previously uploaded 32-bit product versions to the Market, to recompile them using the latest 64-bit MetaEditor and to upload the new versions. The ability to run 32-bit MQL5 programs in terminals will be completely disabled soon.
  7. MQL5: Added support for operations with complex numbers.

    Added new built-in type "complex".
    struct complex
      {
       double             real;   // Real part
       double             imag;   // Imaginary part
      };
    The "complex" type can be passed by value as a parameter for MQL5 functions (in contrast to ordinary structures, which are only passed by reference). For functions imported from DLLs, the "complex" type must be passed only by reference.

    The 'i' suffix is used to describe complex constants:
    complex square(complex c)
      {
       return(c*c);
      }
      
    void OnStart()
      {
       Print(square(1+2i));  // A constant is passed as a parameter
      }
    
    // "(-3,4)" will be output, which is a string representation of the complex number 
    Only simple operations are currently available for complex numbers: =, +, -, *, /, +=, -=, *=, /=, ==,!=.

    Support for additional mathematical functions will be added later, enabling the calculation of the absolute value, sine, cosine and others.

  8. MQL5: New error code TRADE_RETCODE_HEDGE_PROHIBITED — opening of a position or placing of a pending order is not allowed because hedge positions are prohibited. The error is returned if a user tries to execute a trading operation in case the hedging is disabled for the account and an opposite order or position already exists for the same symbol.
  9. VPS: Fixed environment migration to a VPS. An error could occur for Expert Advisors containing indicators as resources.
  10. MetaEditor: Fixed debugging and profiling termination in non-visual mode.
  11. MetaEditor: Fixed indicator profiling on real data. Such profiling could fail to start under certain conditions.
  12. Signals: Fixed trading mode checks for copied signals. Symbol trading can be limited on the broker side, i.e. the broker can set 'long only', 'short only' or 'close only' conditions. In earlier versions, synchronization required full trading conditions and thus copying was not allowed for all other cases. After the update, partially limited conditions will be considered as "trading". This ability will be especially useful for stock brokers' clients who wish to copy signals.
  13. Tester: Fixed trading session checks during testing. Trading operation execution could fail during testing under certain conditions, in which case the "market closed" error was returned even if the operation was initiated within a trading session.
  14. Updated documentation.

The update will be available through the Live Update system.

 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 platform build 2980: Push notifications for trade operations

MetaQuotes, 2021.06.17 15:07

The MetaTrader 5 platform update will be released on Friday, June the 18th, 2021. The new version features the following changes:

  1. Terminal: Added ability to receive push notifications from the server. You will be notified of executed trading operations even if your terminal is closed.


    Enable trade notifications from the trading server


    In earlier versions, notifications on a mobile device could only be delivered from the trader's desktop terminal. Upon the execution of a trading operation, the terminal sent the relevant notification to MetaQuotes ID specified in settings. Notifications could only be sent from a running terminal. This requirement has been lifted. If a Take Profit triggers on the server while your computer is turned off, you will receive a notification about a closed position from the server.

    To start receiving notifications from the server, you should:

    • Have a real account as server notifications do not work for demo accounts
    • Install MetaTrader 5 for iOS or Android on your smartphone
    • Open the Messages section in the mobile terminal, find your MetaQuotes ID and specify it in the desktop terminal settings
    • Enable server notifications in desktop terminal settings

    The availability of server notifications should be provided by your broker

    Three notification types are supported: orders, deals and balance operations. When you enable the option, the available notification types will be displayed in the terminal log:
    '1222': subscribed to deals, orders, balance notifications from trade server

  2. Terminal: Updated MetaTrader VPS Showcase. The VPS section has become more convenient:

    • The interface adapts to any screen width.
    • The showcase takes up less space vertically to fit in the workspace.
    • The necessary information appears only when it is needed. Payment details only appear after you select a payment plan.


    Improved MetaTrader VPS showcase


    Terminal: In the Strategy Tester panel, added commands for quick switching to MQL5 services and to the Toolbox window. The commands are only displayed in the Overview section, while in other tabs the panel is used to manage testing.


    Fast switching between windows


  3. Terminal: Added saving of window states for MQL5 services. If you leave the Market open before closing the terminal, the relevant window will be open the next time you launch the terminal.
  4. Terminal: Fixed periodic synchronization of the MQL5 account state. Signal copying could fail under certain conditions due to an error.
  5. Terminal: Fixed display of a selection of recommended Market products.
  6. Terminal: Fixed signals context menu in the Navigator. You can use the menu to view the signal to which you are subscribed or to unsubscribe from a signal.
  7. MQL5: Fixed "-" operator error in the implementation of complex numbers in the Standard Library (file MQL5\Include\Math\Alglib\complex.mqh).
  8. MQL5: Now you can use any expressions in initialization sequences, not just constant ones. This improves usability and compatibility with C ++ code.
    struct POINT
      {
       int x,y;
      };
    
    int GetYFunc(y)
      {
       return(y * y);
      }
    
    void SomeFunction(int x1,int x2,int y)
      {
       POINT pt={ x1+x2, GetYFunc(y) };
       ProcessPoint(pt);
      };
  9. MQL5: Fixed an error which occurred during the compilation of union with huge data arrays.
  10. MQL5: Fixed operation of the StringToCharArray function. Now it converts the entire passed string to a Char array instead of stopping at the first terminating null character.
  11. MQL5: Added control for the explicit presence of a constructor call for classes/structures if their parent class does not have a default constructor.
  12. MQL5: Added display of a call place for inline functions in the profiler report.

    In the below example, the func(); call is now highlighted as follows:


    The inline function call place is now highlighted


    The func function itself is not highlighted since its full code is placed in OnStart.

  13. MetaEditor: Added ability to create empty projects. This is a useful feature for non-standard development projects with specific file structures for which the default templates are not suitable.


    Now you can create an empty project for any custom designs


    An empty settings file "mqproj" will be created in this case. Source code files should be created manually.

  14. MetaEditor: Implemented faster launching of MetaEditor.
  15. MetaEditor: Fixed data display in the list of observed expressions during debugging. The list could display incorrect variable values under certain conditions.
  16. MetaEditor: Fixed automatic addition of ".py" extension to Python script files created using the MQL Wizard.
  17. Updated documentation.
     

The update will be available through the Live Update system.

Reason: