What's new in MetaTrader 5

The history of updates of the desktop, mobile and web platforms

2 April 2021
MetaTrader 5 build 2875: Improvements and fixes

Terminal

  1. 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. Fixed an error which used to prevent users from logging into the built-in MQL5.community chat.

Tester

  1. Fixed optimization of Expert Advisors via the MQL5 Cloud Network. The optimization could fail to start under certain conditions.

MetaEditor

  1. Fixed errors and crashes during MQL5 program debugging and profiling.

Updated documentation.
26 March 2021
MetaTrader 5 build 2860: Improvements for Wine and SQL integration enhancements

Terminal

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


    All services are enabled by default.

  2. 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. 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. Fixed volatility chart display. Now, the chart is built in accordance with the expiry date selected on the options board.
  5. 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.



MQL5

  1. 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;
  2. 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.

  3. 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.
  4. Optimized and accelerated CopyTicks* functions.

MetaEditor

  1. 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:



  2. Added ability to profile services. The process is similar to other MQL5 programs.
  3. Fixed display of function names in the profiler report. Under certain conditions, the names could be specified as <unknown>.

Documentation has been updated.

26 February 2021
MetaTrader 5 build 2815: Access to the Depth of Market from Python, revamped Debugger, and Profiler improvements

Terminal

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




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



  5. Fixed display of the Subscriptions list when there is no trading account connection.
  6. Fixed links in emails and newsletters. All links now open in the default browser. Previously, links opened only in Internet Explorer.
  7. Fixed connections from the WebRequest function to hosts with IPv6 addresses and Cloudflare protection.
  8. Improved functionality and responsiveness of the VPS service.
  9. Improved operation under Wine and MacOS/Crossover, including the version for macOS Big Sur with the M1 processor.

MQL5

  1. Fixed error in the ArrayPrint function. The function could occasionally fail to print arrays.
  2. Optimized file operations performed by File* functions. Now, file reading and writing operations run much faster.
  3. 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[ ][ ][ ][ ])
      {
      }
  4.  Fixed ArrayBsearch function operation. The function could return an incorrect index of the found element during a binary search.

MetaEditor

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

  2. 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".


    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.

  3. 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)

Tester

  1. Fixed specification of non-trading hours in advanced testing settings.

Updated documentation.
15 January 2021
MetaTrader 5 build 2755: Popup Prices window and Debugger improvements

Terminal

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


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



  3. 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. 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. Improved platform operation under Wine.

MQL5

  1. 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.
  2. Fixed a bug causing a significant error in the Sleep function waiting time.

MetaEditor

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



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

  2. Fixed freezing when opening some projects.

Documentation has been updated.
26 November 2020
MetaTrader 5 build 2715: General improvements

Terminal

  1. Fixed platform freezing when using the options board. Freezing could be caused by a zero tick size specified in trading instrument settings.
  2. Fixed UI display errors on HiDPI displays.

MQL5

  1. Fixed string to time conversion by the StringToTime function. An error could occur when specifying time as "yyyymmdd [hhmiss]".
  2. 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.

MetaTester

  1. Updated rating calculation algorithm for MQL5 Cloud Network testing agents. The rating is now determined more accurately and is changed less frequently.

Documentation has been updated.
12 November 2020
MetaTrader 5 Platform Build 2690: MetaEditor improvements

Terminal

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



MQL5

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




  3. Fixed freezing of Copy* functions when history is not available for a trading instrument.
  4. 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.



MetaEditor

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



  2. Fixed calculation of some observed expressions during program debugging.

Tester

  1. Trading is now prohibited for Expert Advisors running in the Strategy Tester in the frame receiving mode.
  2. Fixed importing of optimization results in the Strategy Tester. An error could cause timeframe values to be imported incorrectly.

Documentation has been updated.
9 October 2020
New MetaTrader 5 platform build 2650: Background chart loading and MQL5 code profiler improvements

Terminal

  1. 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, and the relevant data will be immediately available for analysis.




  2. Fixed generation of daily bars after weekends.
  3. Fixed chart updating. Charts could occasionally fail to update after the additional download of updated price data.
  4. Optimized updating of the account trading history cache. The optimization enables the reduction of data delays when using History* functions.
  5. Fixed display of the Comment column when displaying trading history as positions.
  6. Fixed display of the Signal subscription renewal button.

MQL5

  1. 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 occur more often where more 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. On 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.




  2. Fixed CopyTicksRange function operation. The function could sometimes return incomplete data.
  3. 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.
  4. 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.
  5. Optimized and significantly accelerated addition of trading instruments to the Market Watch using the SymbolSelect function.
  6. 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.

Tester

  1. 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 might mistakenly think the settings would be applied during testing.




  2. Fixed an occasional error related to the receiving of orders from the trade history by ticket.

MetaEditor

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



     
  2. MetaEditor: All icons in the toolbars have been updated to support HiDPI monitors.

Documentation has been updated.

17 September 2020
MetaTrader 5 build 2615: Fundamental analysis and complex criteria in the Strategy Tester

Terminal

  1. 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. 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. Fixed potential profit/loss calculation for Stop Loss and Take Profit chart levels.



  4. Fixed errors in the calculation of synthetic instruments. The errors could occasionally cause the platform to freeze at startup.
  5. Fixed display of built-in Fractals indicator values in the Data Window.
  6. All icons in the platform toolbars have been updated to support HiDPI monitors.
  7. 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. Optimized price history rebuilding after relevant changes on the server.
  9. 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. 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.

MQL5

  1. 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");
      }
  2. 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.

  3. 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.
  4. Optimized and accelerated operations with the account tick history via History* functions.
  5. 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.
  6. Fixed WebRequest function calls from services. Previously, a function call could fail after service restart.
  7. 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.
  8. Fixed application of templates to a chart through the ChartApplyTemplate function.
  9. Fixed ChartSetInteger function call with the CHART_BRING_TO_TOP parameter.
  10. 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.
  11. 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.

Tester

  1. Optimized operations with MQL5 Cloud Network. Fixed loading of Expert Advisors on agents.
  2. 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.



  3. Fixed calculation of custom commissions in the Strategy Tester.

MetaEditor

  1. 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.
Updated documentation.

24 July 2020
MetaTrader 5 build 2560: Built-in learning system improvements

Terminal

  1. In the previous platform update, we have presented a completely revised learning system. Further improvements have been implemented in the latest version:
    • The progress bar icon has become more visible
    • The text of some hints has been revised
    • Learning progress calculation has been fixed
    Complete all lessons to start using the platform capabilities to the maximum.


  2. Optimized and significantly accelerated processing of large tick streams (with more than tens of thousands of ticks per minute).
  3. Fixed errors in the calculation of price changes relative to the previous session close price. To view this variable, enable the "Daily Change" column in the Market Watch context menu.

MQL5

  1. Optimized and accelerated access to numerical chart properties via the ChartGetInteger function.
  2. Fixed custom indicator search, when such an indicator is requested from an MQL5 program via the iCustom function.

MetaEditor

  1. Added compilation of C/C++ programs in projects.

Tester

  1. Significantly optimized work of the MQL5 Cloud Network. Now, the Network can distribute tasks and return calculation results faster due to the improved agent search efficiency.

Updated documentation.

10 July 2020
MetaTrader 5 build 2530: Sorting in Market Watch and advanced operations with optimization results

Terminal

  1. A sorting option has been added to the Market Watch window:

    • Click on a column name to sort the list by required data, such as the symbol name, close price, daily change or other variables.
    • Use the new menu with the most popular sorting options. Sorting by the highest growth and fall based on a daily symbol price change can be useful when trading exchange instruments.



  2. Redesigned and improved built-in learning system.
    All interactive hints are grouped into various categories for easier navigation. The number of completed and remaining hints is shown for each category.



    Every hint is now provided with a checklist, indicating the key action which the user should execute in order to complete training.
    We have also revised the learning system design and fixed errors in the total progress calculation.

  3. Added automated calculation of a symbol's previous session close time and of its current session open time. If the appropriate data is not provided by the broker directly, the terminal will calculate the values based on the first and the last quotes in a session. The relevant information can be displayed in the Market Watch window: enable appropriate columns in the "Symbols" section or navigate to the "Details" section.



  4. Optimized and accelerated application of prices to open positions. When new ticks arrive in the terminal, prices, profit and margin requirements are updated faster.
  5. Fixed calculation of the built-in Stochastic Oscillator. An error could occur in the case where a limited number of bars was displayed on charts.

MQL5

  1. Optimized and accelerated AccountInfo* function which provides access to trading account properties.
  2. Optimized and accelerated access to numerical chart properties via the ChartGetInteger function.

MetaEditor

  1. The following context menu commands have been added to the code editing tabs for efficient operations with the MQL5 Storage:

    • Compare a working copy of a file with the current revision
    • Revert changes
    • View file change history



  2. Changed the highlighting of matching brackets. Now, highlighting is applied to brackets instead of the background. The highlighting is disabled by default. It can be enabled in editor settings.


  3. Improved search and replace functions:

    • If you select a text in the file and bring up the search box, the text will be automatically substituted in the "Find" field. If no text is selected, a text from the clipboard will be pasted in the "Find" field. If the clipboard is empty, the focus in the search box will be set to the "Find" field.
    • A similar behavior is implemented for the replace window: the selected text is inserted in the search field, and the cursor is moved to the "Replace with" field. Thus, you can immediately enter the required new text.
    • Search and replace results are now displayed in the log instead of the previously used separate dialog box. If the Toolbox window is enabled, the Journal tab will be automatically selected in it. Thus, you do not need to work with extra windows.

  4. Fixed search in the file comparison window when working with the MQL5 Storage.
  5. Added possibility to search and replace data in files connected to the current file via the #include directive.

    The new option enables faster operations with projects consisting of multiple files. For example, to replace a text in all files, you will not need to specify their directories manually. The editor can automatically find them through the #include directives.



Tester

  1. We have revised optimization criteria which include two variables, one of which is the balance. Now, the criteria only take into account the second variable and ignore the balance. The new optimization criteria are easier to analyze.

    • Balance + Maximum Profitability -> Maximum Profitability
    • Balance + Maximum Expected Payoff -> Maximum Expected Payoff
    • Balance + Minimum Drawdown -> Minimum Drawdown
    • Balance + Maximum Recovery Factor -> Maximum Recovery Factor
    • Balance + Maximum Sharpe Ratio -> Maximum Sharpe Ratio



  2. New quick commands in the "Optimization parameters" submenu, allow showing or hiding, of all input columns in the table with optimization results:



  3. Added coloring for the optimization results table and graph, for a more convenient visual analysis.
    The graph is colored with a green-to-red gradient, depending on the value of the optimization criterion. The following colors are used for the table:

    • Balance: values above the initial deposit are colored in blue, and those below the initial deposit are shown in red.
    • Profit: blue is used for values greater than zero, and red is used for values less than zero.
    • Expected Payoff: blue is used for values greater than zero, and red is used for values less than zero.
    • Drawdown: from green (0-5%) to red (greater than 30%).
    • Sharpe Ratio: from green (greater than 2) to red (less than 0).
    • Recovery Factor: from green (greater than 2) to red (less than 1).



  4. Filters have been added in the optimization results table. Use the filters to hide unsuccessful passes from the list:

    • Passes without trades
    • Loss-making passes
    • Passes with the drawdown greater than 50%
    • Passes with the Recovery Factor less than 1
    • Passes with the Sharpe Ratio less than 0.5



  5. Optimized work of the MQL5 Cloud Network. Now, when an optimization is launched for the same Expert Advisor, the network tries to use the same testing agents which were used during the previous optimization pass. This is because the required market environment, including the trading history, is already available for such agents.
Updated documentation.
5 June 2020
MetaTrader 5 build 2485: iCustom improvements and overall optimization in MQL5

Terminal

  1. Optimized and significantly accelerated bar history editing for custom financial instruments. The improvement also concerns the CustomRatesUpdate function.
  2. Fixed exporting of custom symbol settings to a JSON file.
  3. Fixed errors reported in crash logs.

MQL5

  1. This version features a revised custom indicator loading algorithm via iCustom.

    If the backslash '\' is indicated before the custom indicator name, the EX5 indicator file is searched relative to the MQL5 root folder. So, for a call of iCustom(Symbol(), Period(), "\FirstIndicator"...), the indicator will be loaded as MQL5\FirstIndicator.ex5. If the file is not found at this path, error 4802 (ERR_INDICATOR_CANNOT_CREATE) is returned.

    If the path does not start with a backslash '\', the indicator is searched and loaded based on the following sequence of actions:

    • The EX5 file is searched in the same folder, where the caller program's EX5 is located. For example, the CrossMA.EX5 Expert Advisor is located at MQL5\Experts\MyExperts. It contains the following call: iCustom(Symbol(), Period(), "SecondIndicator"...). In this case, the indicator is searched at MQL5\Experts\MyExperts\SecondIndicator.ex5.
    • If the indicator is not found, a search relative to the Indicators root directory is performed: MQL5\Indicators. Thus, file MQL5\Indicators\SecondIndicator.ex5 is searched. If the indicator is not found, the function returns INVALID_HANDLE and error 4802 (ERR_INDICATOR_CANNOT_CREATE) is raised.

    If the indicator path is set in a subdirectory such as MyIndicators\ThirdIndicator, the search starts in the folder of the calling program (the Expert Advisor is located in the folder MQL5\Experts\MyExperts) at the following path: MQL5\Experts\MyExperts\MyIndicators\ThirdIndicator.ex5. In case of failure, file MQL5\Indicators\MyIndicators\ThirdIndicator.ex5 is searched. Please note that the path separator should be specified as a double backslash '\\'. For example: iCustom(Symbol(), Period(), "MyIndicators\\ThirdIndicator"...)

    Also, if a custom indicator call via iCustom is found in the program code, the compiler will implicitly add the "#property tester_indicator XXX" directive if it is not specified.

  2. Optimized and significantly accelerated HistorySelect function, which allows requesting the history of deals and orders.
  3. Fixed an occasional error in tick requesting via the CopyTicksRange function. The error caused the range beginning to be set to the day beginning rather than to the specified time.
  4. Optimized and significantly accelerated display of alerts via the Alert function.
  5. New property SYMBOL_TIME_MSC for the symbol's last tick time in milliseconds. The property can be obtained using the SymbolInfoInteger function.
29 May 2020
MetaTrader 5 Platform build 2470

Terminal

  • Fixed a bug which caused the inability to add financial symbols with '-', '=', '_' and '+' in their names into Market Watch.

MQL5

MetaEditor

  • Fixed expanded search by the '\n' and '\r' end-of-line characters.
Updated documentation.
22 May 2020
MetaTrader 5 Platform Build 2450: "Subscriptions" service, UI improvements and revised features in MetaEditor

Terminal

  1. We have released the all-new Subscriptions service. Subscriptions offer additional services which can assist you in trading. For example, you can subscribe to high-quality market data from well-known providers, analyze received data and develop new trading strategies. Optionally, you can request personal manager services to help you in learning trading basics or in mastering your platform usage skills.

    The service is currently under development and will become available for use in the next versions.

    How it works
    A new Subscriptions section has been added in the Navigator. All available services are displayed under this section. The list of services is configured on the broker side and thus it depends on the server to which you are connected. Subscriptions are divided into categories for easy browsing.



    Select a service to view its detailed description. Next, click Subscribe. All your active subscriptions are displayed under a separate section.


    When you subscribe to market data, appropriate trading instruments become available for selection in Market Watch. They can be used as regular symbols: view quotes in Market Watch, open charts and analyze them using objects and indicators, as well as run Expert Advisors in the strategy tester. Trading operations for these symbols are not supported.

    How to pay for subscriptions
    You can pay for the services using your trading account funds. There is no need to visit other websites, as the payment can be performed directly from the platform.

    Soon, we will add the possibility to purchase market data subscriptions by connecting to MetaQuotes-Demo
    We plan to set up subscriptions to market data from various exchanges around the world. In just a few clicks, you will be able to receive real-time quotes from Nasdaq, CME, NYSE, BOVESPA and other exchanges. You will be able to pay for subscriptions using an MQL5.community account, similarly to Market, Signals and Hosting purchases.

  2. Added new "Show ticker" option in chart settings. The option shows/hides the line containing the trading symbol name, the timeframe and a custom comment.




  3. Added option "Show trading history" in terminal settings and in chart settings. The ability to display market entries and exits on charts was available in previous versions but it was managed from the "Toolbox \ History" section. The new option enables a more comfortable setting of history display. You can configure it for all charts at a time or set separately for desired charts.



    Furthermore, you can quickly enable the display of trading history and trading levels using the chart context menu:



  4. Added new "Color on White" scheme in chart settings.



  5. New commands have been added to position and order context menus, enabling quick opening of the relevant symbol's Market Depth and chart:



  6. Added chart frame highlighting. This will help you to find the desired symbol chart when multiple charts are open in the terminal. Select a symbol in the Market Watch, an order or position line in the trading or history section, or an alert, and the frame of the appropriate symbol chart will blink three times.


  7. Improved display of trading levels on the chart.
    • Tickets are no longer displayed for positions, orders and levels, in order to keep the chart clean
    • Captions appear in uppercase for better readability
    • Volumes are displayed without the fractional part if it is zero
    • Levels are hidden if the chart height is less than 80 pixels


  8. Added display of symbol description (if it is available) in the upper left chart corner, in addition to symbol name.




  9. New columns have been added in the list of open orders and positions:
    • Change — operation profitability percentage
    • Value — the market value of the position
    • Magic — the identifier of orders and positions opened by the Expert Advisor (magic number)

    The new columns can be shown/hidden using the context menu.

    Position value and magic columns have also been added to the trading history section.

    Furthermore, the profit field in the open positions and history sections is highlighted depending on the operation result.

  10. Added support for negative prices. This enables proper platform operation in situations similar to the recent drop of oil prices below zero. This includes:
    • Display of quotes in Market Watch
    • Display of charts and Market Depth
    • Execution of trading operations
    • Calculation of profits and collateral

  11. The maximum number of symbols which can be simultaneously enabled in Market Watch has been increased to 5000.
  12. Fixed sorting in chats by the last update date.
  13. Optimized and accelerated operation with a large number of trading symbols (50,000 and more).
  14. Fixed a bug due to which it was impossible to close a position if its current volume did not correspond to the symbol's volume change step.

MQL5

  1. Optimized and accelerated operations with the tick history.
  2. Added new functions for working with databases:
    • DatabaseReset — resets the request to the initial state, similar to DatabasePrepare call. The function is intended for multiple execution of a request with different parameter values. For example, when adding data to the table in bulk using the INSERT command, a custom set of field values should be formed for each entry.
    • DatabaseBind — sets a parameter value in a request. The function is used in case an SQL request contains "?" or "?N" parameterizable values where N means the parameter index (starting from one).
    • DatabaseBindArray — sets an array as a parameter value.

  3. Added FSD_FILE_MUST_EXIST flag for the FileSelectDialog function. It indicates that the selected files must exist.
  4. Values for describing options have been added to the ENUM_SYMBOL_INFO_DOUBLE enumeration:
    • SYMBOL_PRICE_CHANGE — change of the current price relative to the end of the previous trading day in %.
    • SYMBOL_PRICE_VOLATILITY — price volatility in %.
    • SYMBOL_PRICE_THEORETICAL — theoretical option price.
    • SYMBOL_PRICE_DELTA — option/warrant delta. Shows the value the option price changes by, when the underlying asset price changes by 1.
    • SYMBOL_PRICE_THETA — option/warrant theta. Number of points the option price is to lose every day due to a temporary breakup, i.e. when the expiration date approaches.
    • SYMBOL_PRICE_GAMMA — option/warrant gamma. Shows the change rate of delta — how quickly or slowly the option premium changes.
    • SYMBOL_PRICE_VEGA — option/warrant vega. Shows the number of points the option price changes by when the volatility changes by 1%.
    • SYMBOL_PRICE_RHO — option/warrant rho. Reflects the sensitivity of the theoretical option price to the interest rate changing by 1%.
    • SYMBOL_PRICE_OMEGA — option/warrant omega. Option elasticity — a relative percentage change of the option price by the percentage change of the underlying asset price.
    • SYMBOL_PRICE_SENSITIVITY — option/warrant sensitivity. Shows by how many points the price of the option's underlying asset should change so that the price of the option changes by one point.

  5. Added export of BLOB fields in HEX format in the DatabaseExport function.
  6. New CHART_SHOW_TICKER property has been added to ENUM_CHART_PROPERTY_INTEGER — showing a symbol ticker in the upper left corner. If CHART_SHOW_TICKER is set to false, CHART_SHOW_OHLC is also set to false and thus OHLC is hidden.   
  7. The quality of code generated by the compiler has been improved. This enabled the increase of its execution speed.
  8. Fixed errors related to the compilation and execution of template functions and classes. These are:
    • Priority mismatch error for overloaded template function calls
    • Template method/class generation error
    • Error caused by an attempt to access an internal class for a template parameter of a template function
    • Template class code generation error caused by the use of an internal class.
    • Error using the B<int> template object before B<void*>
    • Errors in the creation of complex objects having the internal type C and wrapped multiple times
    • Error transferring function pointer argument as const ref template
    • Error passing internal struct to a template function
    • Priority mismatch error for the execution of template functions
    • Incorrect parenthesis count in for and do-while loops
    • Incorrect parenthesis count in class structure description
    • Slowdown when adding one element at a time using ArrayResize
    • Error choosing a matching overloaded function

  9. Fixed occasional errors in the CustomTicksReplace function.
  10. Fixed selection of the display period for the history of trade orders. Now, the range is based on the order execution date instead of the previously used creation date.

Python

  1. The path parameter has been added to the initialize method — path to metatrader.exe or metatrader64.exe. If the path is not specified, the module attempts to find the executable file on its own.
  2. The following new methods have been added:
    • symbols_get — receives all financial symbols from the MetaTrader 5 terminal.
    • symbols_total — obtains the number of all financial symbols in the MetaTrader 5 terminal.

  3. Added filtering by symbol groups for the following functions: orders_get, positions_get, history_orders_get and history_deals_get. Use call forms with the "group" parameter.
  4. The return value of order_send and order_check is now passed with the 'request' field containing the full description of the original request. For example:
    ...
    comment=Request executed
    request_id=55
    retcode_external=0
    request=TradeRequest(action=1, magic=234000, order=0, symbol='USDJPY', volume=0.1, price=108.018, stoplimit=0.0, ...
        traderequest: action=1
        traderequest: magic=234000
        traderequest: order=0
        traderequest: symbol=USDJPY
        traderequest: volume=0.1
        traderequest: price=108.018
        traderequest: stoplimit=0.0
    ...
  5. When launched on a chart, Python scripts now receive the chart symbol and period (in minutes) as arguments.
    import sys
    
    chart_symbol='unknown'
    chart_tf=1
    
    if len(sys.argv) == 3:
        chart_symbol, chart_tf = sys.argv[1:3];
    
    print("Hello world from", chart_symbol, chart_tf)
    
    >> Hello world from T.NYSE 15

MetaEditor

  1. Added command "Add an existing folder". It enables a batch addition of all supported files from the selected directory into the project.


  2. Expanded search and replace options.

    Added extended search features with partial regular expression support. Use \r, \n, \t to specify line feed and tab characters in search requests. Search and replace dialogs have been combined into a single multi-tab dialog.


    Added a separate tab for searching in programmer communities. These include MQL5.community, as well as GitHub, MSDN and Stack Overflow.

    Search results from external resources appear in the MetaEditor toolbox window:



    Furthermore, you can immediately download source files from GitHub. Files are downloaded into a separate subdirectory of the Projects folder, named in accordance with the GitHub project name.

    Search results can be additionally sorted by date.

  3. Added possibility to quickly change font size in the code editing window. To change the font size, press Ctrl and scroll the mouse wheel.
  4. Added possibility to import tables from CSV files to database tables. The following parameters can be set during import:
    • Table name in the database
    • Automatic or manual file encoding detection
    • Data separator type
    • Skipping of the specified number of lines at the beginning
    • Comment prefix
    • If the file has column names
    • How line breaks will be determined
    • Whether data should be added to a new table or to an existing one
    • What quotes to use for strings



  5. Added quick commands for inserting time and color into the program source code. Select the desired values from the interactive calendar and the palette, and the editor will insert them in the appropriate format.



  6. MQL4 support has been disabled, since only 64-bit code is generated now.
  7. Fixed Class snippet operation.
  8. Fixed support for absolute paths in projects.
Updated documentation.


6 March 2020
MetaTrader 5 build 2360: Extension of SQLite integration
  1. MQL5: SQLite database operation errors can now be analyzed using standard MQL5 tools. The following error codes have been added:

    • ERR_DATABASE_ERROR — generic error.
    • ERR_DATABASE_INTERNAL — SQLite internal logic error.
    • ERR_DATABASE_PERM — access denied.
    • ERR_DATABASE_BUSY — database file locked.
    • ERR_DATABASE_LOCKED — database table locked.
    • ERR_DATABASE_NOMEM — insufficient memory for completing operation.
    • ERR_DATABASE_READONLY — attempt to write to read-only database.
    • ERR_DATABASE_IOERR — disk I/O error.
    • ERR_DATABASE_CORRUPT — database disk image corrupted.
    • ERR_DATABASE_FULL — insertion failed because database is full.
    • ERR_DATABASE_CANTOPEN — unable to open the database file.
    • ERR_DATABASE_PROTOCOL — database lock protocol error.
    • ERR_DATABASE_SCHEMA — internal use only.
    • ERR_DATABASE_TOOBIG — string or BLOB exceeds size limit.
    • ERR_DATABASE_CONSTRAINT — abort due to constraint violation.
    • ERR_DATABASE_MISMATCH — data type mismatch.
    • ERR_DATABASE_MISUSE — library used incorrectly.
    • ERR_DATABASE_AUTH — authorization denied.
    • ERR_DATABASE_RANGE — bind parameter error, incorrect index.
    • ERR_DATABASE_NOTADB — file opened that is not database file.

  2. MQL5: Fixed operation of the DatabaseImport function which enables data import from a file into a database table.
  3. MetaEditor: Fixed output of strings longer than 32KB to logs.
  4. MetaEditor: Fixed occasional incorrect encoding in messages sent from the Python console (stdout, stderr) into the Errors section of the editor.
  5. Updated documentation.


21 February 2020
MetaTrader 5 Build 2340: Managing account settings in the Tester and expanded integration with Python

MetaEditor

  1. Added new functionality for working with SQLite databases.

    In the previous platform update, we introduced support for operations with SQLite databases directly from MQL5. The main functions have become available through the MetaEditor user interface:

    • Create and connect databases
    • View tables and perform quick data queries
    • Create and execute SQL queries and rollback changes

    How it works
    The quick database creation functionality is available from the MQL5 Wizard. You can easily create your first table and define its fields.


    Upon the database creation, you will be forwarded to a new Navigator section, which features commands for managing the data.

    Database tables are shown in the left-hand side window. Double-click on the table name to quickly query the first 1,000 records. In this navigator section, you can also create and open other databases, as well as work with tables.

    The database can be managed in the main editor window, in which you can fill in the table, search and select data, enter SQL queries and execute other operations:


    For further details about MetaTrader 5 operations with databases, please read the article entitled "SQLite: Native handling of SQL databases in MQL5".

  2. Expanded support for multi-lingual projects. This update provides further expanded possibilities for working with Python scripts:

    • Now, such scripts can be created using the MQL5 Wizard, while you can instantly add required library dependencies in the code.
    • Special icons have been added in the navigator and the relevant syntax is available in the editor.
    • When running a script via MetaEditor, messages from the Python console (stdout, stderr) appear under the Errors section.


    Click "Compile" in the editor to run the script:


    To work with Python, do not forget to specify its path under the Settings \ Compilers section in MetaEditor. To enable the use of the MetaTrader 5 library, install it using the following command:
    pip install MetaTrader5
    For Python integration details please read the relevant documentation.
  3. Added display of SQLite database files (*.db;*.sdb;*.sqlite;*.db3;*.s3db;*.sqlite3) in the Navigator.
  4. Fixed project property saving errors.

MQL5

  1. Completely revised Python integration. The update involves many new functions and new command naming.

    New naming
    The existing commands have been renamed as follows:
    MT5Initialize       -> initialize
    MT5Shutdown         -> shutdown
    MT5TerminalInfo     -> terminal_info
    MT5Version          -> version
    MT5CopyRatesFrom    -> copy_rates_from
    MT5CopyRatesFromPos -> copy_rates_from_pos
    MT5CopyRatesRange   -> copy_rates_range
    MT5CopyTicksFrom    -> copy_ticks_from
    MT5CopyTicksRange   -> copy_tick_range

    New commands
    The list of supported commands has been expanded. Added trading functions, as well as functions for working with the trading history and for receiving financial symbol and current account data.

    • account_info() receives information about the current account. An analogue of AccountInfoInteger , AcountIndoDouble and AccountInfoString.
    • positions_total() receives the number of open positions. An analogue of PositionsTotal.
    • positions_get(symbol, ticket) receives open positions by symbol or ticket.
    • orders_total() receives the number of orders. An analogue of OrdersTotal.
    • orders_get(symbol, ticket) receives open orders by symbol or ticket.
    • history_orders_total(from, to) receives the number of orders in the specified historical time frame.
    • history_orders_get(from, to, position, ticket) receives orders from the specified historical time frame, by ticket or as filtered by position.
    • history_deals_total() receives the number of deals in the history. An analogue of HistoryDealsTotal.
    • history_deals_get(from, to, position, ticket) receives deals from the specified historical time frame, by ticket or as filtered by position.
    • symbol_info(symbol) receives information about a financial instrument. An analogue of SymbolInfoInteger, SymbolInfoDouble, SymbolInfoString.
    • symbol_info_tick(symbol) receives the last tick by symbol. An analogue of SymbolInfoTick.
    • symbol_select(symbol, enable) enables/disables a symbol in Market Watch. An analogue of SymbolSelect.
    • order_check(request) checks order margin. An analogue of OrderCheck.
    • order_send(request) sends an order to the server. An analogue of OrderSend.
    • order_calc_margin(action, symbol, volume, price) calculates margin for an order. An analogue of OrderCalcMargin.
    • order_calc_profit(action, symbol, volume, price_open, price_close) calculates profit. An analogue of OrderCalcProfit.

    Running Python scripts on charts
    Python scripts can be run directly on platform charts, similarly to regular MQL5 programs. These scripts are marked with special icons in the Navigator.


    Script messages will be displayed under the "Toolbox \ Experts" section. If a MetaTrader 5 library is used in the script, it can receive trading symbol and account data, as well as perform trading operations.

    Python scripts can be executed on the same chart in parallel with other MQL5 scripts and Expert Advisors. To stop a script with a looped execution, remove it from the chart.

    Additional protection
    To enable additional account protection when using third-party Python libraries, you may activate the "Disable automated trading via external Python API" option in terminal settings.


    Python scripts can only perform trading operations when this option is disabled.

  2. Significantly accelerated re-launch of MQL5 programs and re-creation of custom indicators from MQL5 programs. In some cases, operations are performed 100 times faster.
  3. Added functions for working with databases:

    DatabaseImport
    Imports data from a file to a table.
    long  DatabaseImport(
       int           database,          // database handle received in DatabaseOpen
       const string  table,             // table name to insert data to
       const string  filename,          // file name to import data from
       uint          flags,             // combination of flags
       const string  separator,         // data separator
       ulong         skip_rows,         // number of first rows to skip
       const string  skip_comments      // string of characters, which define comments
       );

    DatabaseExport
    Exports a table or an SQL query result to a CSV file. The file is created in UTF-8 encoding.
    long  DatabaseExport( 
       int           database,           // database handle received in DatabaseOpen 
       const string  table_or_sql,       // table name or SQL query
       const string  filename,           // CSV file name for data export
       uint          flags,              // combination of flags
       const string  separator           // data separator in the CSV file
       );

    DatabasePrint
    Prints the table or SQL query result to the Experts journal.
    long  DatabasePrint(
       int           database,          // database handle received in DatabaseOpen
       const string  table_or_sql,      // table or SQL query
       uint          flags              // combination of flags
       );

  4. Added FileSelectDialog function, which calls the system dialog creating/opening a file or a folder.
    int  FileSelectDialog(
       string   caption,              // window title
       string   initial_dir,          // initial directory
       string   filter,               // extension filter
       uint     flags,                // combination of flags
       string&  filenames[],          // array with file names
       string   default_filename      // default file name
       );
    The new function enables the efficient user interaction with the MQL5 program.

  5. New DEAL_FEE value in the ENUM_DEAL_PROPERTY_DOUBLE enumeration. It is used for a deal fee. The value indicates a separate commission type charged by the broker.

Tester

  1. : Added functionality to specify custom trading account settings during strategy testing, such as trading limitations, margin settings and commission. The new functions provide extended capabilities for the modeling of various trading conditions.



    Common settings
    In this section, you can set the maximum number of open orders and positions, which can simultaneously exist on the account. Additionally, you can configure sessions during which the program is not allowed to trade.

    Margin
    The section allows configuration of margin reserving rules and position accounting systems to be used in testing:

    • Risk management — risk management model: OTC and exchange model, netting and hedging systems. For details please read the Documentation.
    • Margin call level — when this level is reached, the account switches to the Margin Call state.
    • Stop out level — when this level is reached, all orders are canceled and all trading positions are closed. These levels can be indicated in percentage and in money. If "in money' is selected, the levels are defined as the account's Equity value. If "In percent" is selected, the levels are defined as the account "Margin level" value (Funds/Margin*100).
    • Unrealized profit — accounting for the current floating profit/loss in the free margin:
      • Do not use unrealized profit/loss — do not include profit/loss of open positions in the calculation.
      • Use unrealized profit/loss — include open positions' profit/loss in the calculation.
      • Use unrealized profit — include only profit.
      • Use unrealized loss — include only loss.
    • Daily fixed profit — accounting for the client's daily fixed profit/loss in the free margin:
      • Use daily fixed profit/loss — include in the free margin profit and loss received during a trading day.
      • Use daily fixed loss — include only loss received during the trade day. During the day, the obtained profit is accumulated in the special account field ("Blocked"). At the end of the trading day, the accumulated profit is released (zeroed) and is added to the account balance (included in the free margin).
    • Release fixed profit at the end of day — this option becomes available only if the option "Use daily fixed loss" is selected. If it is enabled, the accumulated profit will be released (and thus included in the free margin) at the end of the day. Otherwise this profit amount will remain blocked.

    Commission

    This section provides control over commissions charged for all trading operations.

    • Commission may be single-level and multi-level, i.e. be equal regardless of the deal volume/turnover or can depend on their size. Appropriate data is displayed in the terminal.
    • Commission can be charged immediately upon deal execution or at the end of a trading day/month.
    • Different commissions can be charged depending on deal direction: entry, exit or both operation types.
    • Commission can be charged per lot or per deal.
    • Commission can be calculated in money, percentage or points.


  2. Optimized and accelerated work in the Market Scanner mode, during which multiple testing passes are run for all symbols available in the Market Watch.
  3. Deal or position size is now taken into account when calculating profit in pips. Previously, the calculation was only performed per one lot.
  4. Improved control over optimization results graph. The scroll option has been added for a zoomed optimization graph. Double-clicking on a graph point selects the corresponding result in the table of testing passes.
Updated documentation.
13 December 2019
MetaTrader 5 Platform Build 2280

Terminal

  1. Fixed a bug which caused inability to delete an Expert Advisor from the chart having no data.
  2. Fixed chart header display under Wine.

MQL5

  1. Improved loading and compilation speed of MQL5 programs.
  2. A double click on a chart is now passed as a single-click event to an MQL5 program. Previously, such events were not handled.
  3. Fixed StringTrimRight function operation.
  4. Added documentation for DirectX 3D visualization functions.

Tester

  1. Fixed a bug which cased the testing symbol in settings to be empty. The error could result from switching between trading accounts with different sets of trading instruments. The new behavior: if the previously selected symbol is not found in the currently connected trading account, the first available symbol In Market Watch is automatically selected instead.

MetaEditor

  1. Fixed application icon loading when reopening project properties.

Updated user interface translations.
Fixes based on crash logs.
6 December 2019
MetaTrader 5 Platform build 2265: DirectX functions for 3D visualization in MQL5 and symbol settings in Strategy Tester

Terminal

  1. More columns have become available in Market Watch. The main section now features 40 additional symbol parameters, which were previously available only under the Details tab.




  2. Added highlighting of the currently connected account and the current server in the Navigator. The function will be useful if you have multiple accounts with different brokers.




  3. Updated frame design for charts. Frames have become smaller and thus more space is now available for useful information.




  4. Modified algorithm for calculating trading totals when displaying the trading history as positions. The values are now calculated based on actual records.

    To display the trading history as positions, the terminal uses information about deals executed during the requested period. Only the positions closed within this period will be shown in history. If the position is still open or its close time does not fall within the selected interval, it will not be displayed in the history. Therefore, the total profit and commission in the 'positions' mode can differ from those in the 'orders/deals' history mode.

    For example, you are viewing the past week history. During this period, 100 deals were executed, 98 of which participated in the opening and closing of 20 positions. The last two deals opened new positions, which have not been closed up to now. In this case, the history of deals contains 100 records and appropriate total values calculated based on these deals. When viewing the history as positions, you will see 20 records collected based on 98 deals. Only this data will be taken into account when calculating total values. If the broker charges entry deal fees, the final commission value in the deals history will differ from the commissions shown in the positions history, because the two last deals will be ignored in the latter case.

  5. Implemented faster launching of MQL5 programs.
  6. New /beta key has been added for the terminal installation file, which allows downloading the beta version. In normal mode, the release version should be installed first, which can then be updated till a beta version. By skipping this step, you can save time and traffic. Installation start example:
    C:\mt5setup.exe /beta
  7. Fixed display of margin requirements for instruments with the "Exchange Stocks" type.
  8. Accelerated operation of all platform components through the use of the Clang/LLVM compiler. In some cases compilation is 20% faster.

MQL5

  1. Added new DirectX 11 functions and shaders for 3D visualization. Now powerful three-dimensional graphics can be created directly in MQL5.

    The new CCanvas3D class is an extension of the CCanvas custom graphics class. It is available in the \MQL5\Include\Canvas\ directory. The class features functions for rendering three-dimensional objects via DirectX API.

    • Create — creates a scene.
    • Attach — binds a scene to a chart.
    • Destroy — destroys a scene.
    • ObjectAdd — adds to the scene a descendant object inherited from the base CDXObject class.
    • Render — the full render loop, with buffer clearing and rendering of all CDXObject, added via the ObjectAdd method.
    • RenderBegin — starts scene rendering, fills the render buffer with the specified color (if DX_CLEAR_COLOR flag is set) and the depth buffers (when using DX_CLEAR_DEPTH), as well as sets the DXInputScene scene buffer for default shaders.
    • RenderEnd — completes scene rendering and receives a result to an internal buffer. If redraw==true, displays the image on the chart, on which it is running.
    • ViewMatrixGet — receives a view matrix.
    • ViewMatrixSet — sets a view matrix. The matrix is not compatible with ViewPositionSet, ViewRotationSet, ViewTargetSet and ViewUpDirectionsSet methods.
    • ViewPositionSet — sets camera position.
    • ViewRotationSet — sets camera rotation matrix.
    • ViewTargetSet — sets the point the camera is pointing at. Together with ViewUpDirectionsSet, it is an alternative to ViewRotationSet.
    • ViewUpDirectionsSet — sets the vertical position of the camera. Together with ViewTargetSet, it is an alternative to ViewRotationSet.
    • ProjectionMatrixGet — receives a projection matrix.
    • ProjectionMatrixSet — sets a projection matrix.

    Detailed documentation for the new library will be published soon.




  2. Added support for operations with SQLite databases directly from MQL5. This enables easy execution of SQL queries without creating complex instructions. The internal operation is implemented by the new standard library extension.

    The following functions are available:

    • DatabaseOpen — opens or creates a database in the specified file
    • DatabaseClose — closes a database
    • DatabaseTableExists — checks if there is a table in the database
    • DatabaseExecute — executes a query to the specified database
    • DatabasePrepare — creates a query handle, which can be further executed using DatabaseRead()
    • DatabaseRead — jumps to the next record in the query result
    • DatabaseFinalize — deletes a query which was created in DatabasePrepare()
    • DatabaseTransactionBegin — starts the execution of a transaction
    • DatabaseTransactionCommit — completes the execution of a transaction
    • DatabaseTransactionRollback — rolls back a transaction
    • DatabaseColumnsCount — receives the number of fields in a query
    • DatabaseColumnName — receives field name by number
    • DatabaseColumnType — receives field type by number
    • DatabaseColumnSize — receives field size in bytes
    • DatabaseColumnText — receives a string value of a field from the current record
    • DatabaseColumnInteger —  receives an int value from the current record
    • DatabaseColumnLong — receives a long value from the current record
    • DatabaseColumnDouble — receives a double value from the current record
    • DatabaseColumnBlob — receives an array of field values from the current record

    The following error codes have been added for function operations:

    • ERR_MQL_DATABASE_INTERNAL (5120) — internal database error
    • ERR_MQL_DATABASE_INVALID_HANDLE (5121) — invalid database handle
    • ERR_MQL_DATABASE_TOO_MANY_OBJECTS (5122) — maximum number of Database objects exceeded
    • ERR_MQL_DATABASE_CONNECT (5123) — database connection error
    • ERR_MQL_DATABASE_EXECUTE (5124) — request execution error
    • ERR_MQL_DATABASE_PREPARE (5125) — request creation error
    • ERR_MQL_DATABASE_NO_MORE_DATA (5126) — no more data to read
    • ERR_MQL_DATABASE_STEP (5127) — error moving to the next query record
    • ERR_MQL_DATABASE_NOT_READY (5128) — data to read query results is not yet ready
    • ERR_MQL_DATABASE_BIND_PARAMETERS (5129) — SQL query auto-substitution error

  3. Added new property of MQL5 programs, which enables the selection of a default visualization method.
    #property optimization_chart_mode "3d,InpX,InpY"
    The property allows setting the type of chart which opens at the end of optimization, as well as program parameters for the X and Y axes.

    The property only sets the default chart view. It can be changed manually at any time, using the context menu.

  4. MQL5: New MathArctan2 function. Returns the radian value of the angle, the tangent of which is equal to the ratio of the two specified numbers.
    double  MathArctan2(
       double  y      // the y coordinate of the point
       double  x      // the x coordinate of the point
       );
  5. We have performed the general optimization of programs to improve performance and reduce resource consumption.
  6. Added examples of math calculations which can be performed in the strategy tester. They are available under the \MQL5\Experts\Examples\Math 3D\ directory.
  7. Introduced tighter control of namespaces.
  8. Added loading of linked libraries when using .NET libraries in MQL5 programs. If the used .NET library requires other libraries for operation, the compiler will try to download required libraries automatically from \MQL5\Libraries.
  9. Fixed time operations in the MetaTrader module for Python integration. Now all output data use the time of the trading server to which the terminal is connected.

Tester

  1. A plethora of new features and improvements:


    Custom settings for financial instruments
    Now you can change settings of the main trading instrument, for which testing/optimization is performed. Almost all specification parameters can be overwritten: volumes, trading modes, margin requirements, execution mode and other settings. Thus, if you need to check an Expert Advisor under different conditions, there is no need to create a separate custom symbol and download its history. This can be done by changing standard symbol settings.



    If the symbol specification is customized, the gear icon and the symbol icon are marked with an asterisk. This shows that custom parameters are used for the current test.




    Last settings/Expert Advisors/charts
    Use the new context menu commands for fast testing or optimization setup. Choose the last used tester settings, recent charts or applications:


MetaEditor

  1. Added ability to work with C/C++ and Python projects directly from MetaEditor. Now, multi-lingual projects can be managed using the built-in editor.

    If appropriate compilers are installed on your PC, MetaEditor will detect them and add to settings. Optionally, you can specify paths to required components under the Compilers tab. From the same tab, you can download the components by clicking Install next to the appropriate field.




    After that you can work with C/C++ and Python projects similarly to MQL5 programs.

  2. Added support for sub-projects inside the Shared Projects directory intended for shared project development via MQL5 Storage. Previously, only single projects could be created at the top level.
  3. Built-in debugger updates.
  4. Fixed addition of a function header when using a code styler.
  5. 'Jump to previous/next cursor position' commands are now available not only in the View menu, but also on the toolbar.
  6. Spaces can now be used in project names.

Android

  1. Added ability to quickly switch to deposit/withdrawal pages on the broker website.

    There is no need to search for appropriate functions in a trader's room on the broker site. Fast navigation commands are available directly in terminals: users can switch to deposit and withdrawal pages from the Accounts and Trading sections:



    • Deposit/withdrawal operations are only available if appropriate functions are enabled for the trading account on the broker side.
    • The trading terminal does not perform any account deposit/withdrawal operations. The integrated functions redirect the user to the appropriate broker website pages.

  2. Positions in history are sorted now by closing date.
  3. Added marking of positions closed by Stop Loss or Take Profit with red and green vertical lines in the history section.
  4. Added new fields in the trading symbol specification:

    • Category — the property is used for additional marking of financial instruments. For example, this can be the market sector to which the symbol belongs: Agriculture, Oil & Gas and others. The category is displayed only if the appropriate information is provided by the broker.
    • Exchange — the name of the exchange in which the security is traded. The category is displayed only if the appropriate information is provided by the broker.

  5. Added Margin Call state indication in the trading section. Upon the emergence of this state, Margin, Free Margin and Margin Level parameters will be shown in red.
  6. Fixed display of the OTP section opening button in tablets.
  7. Other fixes and improvements.

iPhone/iPad

  1. Added ability to quickly switch to deposit/withdrawal pages on the broker website. For further details, please see the What's New list of MetaTrader 5 for Android.



  2. Added dark mode support for iOS/iPadOS.
  3. The one-time password section has become available in the iPad version.
  4. The positions closed by Stop Loss or Take Profit are marked with red and green vertical lines in the history section.
  5. Positions in history are sorted now by closing date. If the position has not yet been closed, its opening date is used for sorting.
  6. Other fixes and improvements.


22 October 2019
MetaTrader 5 Platform Build 2190

Terminal

  1. Fixed the display order of MQL5 programs in the Navigator.

MQL5

  1. Fixed compilation errors connected with the use of local static variables in programs having input group declarations.

VPS

  1. Fixed requesting of Hosting journals.

Tester

  1. Improved display of three-dimensional optimization charts.
  2. Fixed reception of frames during forward optimization. Now, all frames from the main and forward optimizations are available in the OnTesterDeinit function.
  3. Fixed formation of a tree of symbols in Strategy Tester settings.

Added user interface translation into Punjabi (India).

Documentation has been updated.

Fixes based on crash logs.

The update will be available through the Live Update system.

5 October 2019
MetaTrader 5 platform build 2170: MQL5 scope, global Strategy Tester and built-in Virtual Hosting updates

Terminal

  1. Completely redesigned built-in Virtual Hosting management options. All information about the rented terminal, as well as environment migration, stop and start functions, are now available in a separate tab of the Toolbox window.

    In earlier versions, Virtual Hosting functions were available in the context menu of the Navigator window. Now all the necessary information and control commands are conveniently arranged under the "VPS" tab:




    Basic subscription information appears on the left side:

    • Connection data: comparison of network delays between your terminal on the hosting server and a terminal running on a local PC.
    • Trading account for which hosting was rented and the payment plan.
    • Unique subscription identifier. A click on the ID opens the Hosting section in the MQL5.community user profile, from which the subscription can be managed.
    • Registration date and current state. If the hosting service is stopped, an appropriate status will instantly appear here.

    Using the Start/Stop button, the virtual terminal can be quickly started or stopped.

    Data about hosting server hardware and CPU consumption charts are displayed in the right hand side window section. Based on the displayed information, you will be able to respond in a timely manner if your Expert Advisor or indicator utilizes excessive memory or CPU time.

    Information about the last trading environment migration as well as migration commands are also available here. These commands enable fast environment migration after purchasing a subscription.

    A virtual platform can be rented from the "VPS" tab. The renting process has not changed and it is still fast and easy. You only need to select a plan and a suitable payment method. The best server for connecting to your broker will be selected automatically.




  2. Added ability to quickly switch to deposit/withdrawal operations on the broker website.

    There is no need to search for appropriate functions in a trader's room on the broker site. Fast navigation commands are available directly in terminals: in the accounts menu in Navigator and in Toolbox > Trade tab:



    • Deposit/withdrawal operations are only available if appropriate functions are enabled for the trading account on the broker side.
    • The trading terminal does not perform any account deposit/withdrawal operations. The integrated functions redirect the user to the appropriate broker website pages.
  3. New fields in the trading symbol specification:

    Category
    The property is used for additional marking of financial instruments. For example, this can be the market sector to which the symbol belongs: Agriculture, Oil & Gas and others. The category is displayed only if the appropriate information is provided by the broker.

    Exchange
    The name of the exchange in which the security is traded. The category is displayed only if the appropriate information is provided by the broker.

    Commissions
    Information on commissions charged by a broker for the symbol deals. Calculation details are displayed here:

    • Commission may be single-level and multilevel, i.e. be equal regardless of the deal volume/turnover or can depend on the size. Appropriate data is displayed in the terminal.
    • Commission can be charged immediately upon deal execution or at the end of a trading day/month.
    • Commission can be charged depending on deal direction: entry, exit or both operation types.
    • Commission can be charged per lot or deal.
    • Commission can be calculated in money, percentage or points.

    For example, the following entry means that a commission is charged immediately upon deal entry and exit. If the deal volume is between 0 to 10 lots, a commission of 1.2 USD is charged per operation. If the deal volume is between 11 to 20 lots, a commission of 1.1 USD is charged per each lot of the deal.
    Commission | Instant, volume, entry/exit deals
    0  - 10  | 1.2 USD per deal
    11 - 20  | 1.1 USD per lot



  4. Additional options related fields have been added to symbol specification:

    • Option type — call or put
    • Underlying — the underlying symbol of the option
    • Strike price — option strike price

  5. Added support for the delivery of options "Greeks": delta, gamma, vega, theta, rho. Brokers can provide additional information related to such instruments. The data is displayed under the Details section of the Market Watch window and it can be used for advanced trade analysis:




  6. The Crosshair tool now shows the distance between price levels in percentage, in addition to previously available pips:




  7. Added the display of a resulting price in trading dialogs during Market and Exchange execution operations, if this price is available at the time a response is received from the broker:




  8. Fixed occasional error due to which the "Show All" command in the Market Watch window could fail to show the list of all available trading instruments.

MQL5

  1. The scope operation has been revised and thus MQL5 is even closer to C++. This provides MQL5 programmers with wider possibilities in operations with third-party libraries. The update eliminates the need to modify libraries and to unify identifiers.

    Example: Code contains declaration of two structures with the same name even though they belong to different classes. In earlier versions such a declaration produced a compilation error: "identifier already used". Now this code will be successfully compiled and executed. For a proper access to the desired variable/structure/function from outside of its scope, you should specify a class (in this case it is CBar::Item).
    class CFoo
      {
    public:
       struct Item { int x; };
      };
    //+------------------------------------------------------------------+
    class CBar
      {
    public:
       struct Item { int x; };
      };
      
    CBar::Item item;  // proper declaration of the Item structure from the Bar class
    Item       item;  // incorrect declaration
    Added namespace support which provides more possibilities when using third-party code/libraries in MQL5 applications.

    #define PrintFunctionName() Print(__FUNCTION__)
    
    namespace NS
    {
    void func()
      {
       PrintFunctionName();
      }
    
    struct C
      {
       int               x;
                         C() { PrintFunctionName(); };
      };
    }
    
    struct C
      {
       int               x;
                         C() { PrintFunctionName(); };
      };
    
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    void func()
      {
       PrintFunctionName();
      }
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
      {
       func();
       NS::func();
    
       C c;
       NS::C ac;
      }
    Upon execution the following result is displayed as output:
    2019.09.18 13:39:35.947    TestScript (AUDCAD,H1)    func
    2019.09.18 13:39:35.949    TestScript (AUDCAD,H1)    NS::func
    2019.09.18 13:39:35.949    TestScript (AUDCAD,H1)    C::C
    2019.09.18 13:39:35.949    TestScript (AUDCAD,H1)    NS::C::C

  2. New version features faster access to timeseries data using the following function: iTime, iOpen, iHigh, iLow, iClose, iVolume, iTickVolume, iSpread.

  3. Added support for the "=delete" attribute. It allows prohibition on the use of certain class methods.
    class A
      {
       void              operator=(const A &)=delete;    // prohibit object copying operator
      };
    
    class B : public A
      {
      };
    
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
      {
       A a1,a2;
       B b1,b2; 
      
       a1=a2;
       b1=b2;
      }
    In this example, the compiler will return errors for "a1=a2" and "b1=b2":
    attempting to reference deleted function 'void A::operator=(const A&)'
       function 'void A::operator=(const A&)' was explicitly deleted here

    attempting to reference deleted function 'void B::operator=(const B&)'
       function 'void B::operator=(const B&)' was implicitly deleted because it invokes deleted function 'void A::operator=(const A&)'

  4. The following values have been added to the ENUM_SYMBOL_INFO_STRING enumeration:

    • SYMBOL_CATEGORY — symbol category. It is used for additional marking of financial instruments. For example, this can be the market sector to which the symbol belongs: Agriculture, Oil & Gas and others.
    • SYMBOL_EXCHANGE — the name of the exchange in which the symbol is traded.

  5. Added support for position closure by FIFO rule.

    • ACCOUNT_FIFO_CLOSE value has been added to ENUM_ACCOUNT_INFO_INTEGER. It indicates that positions can be closed only by the FIFO rule. If the property value is true, then positions for each instrument can only be closed in the same order in which they were opened: the oldest one should be closed first, then the next one, etc. In case of an attempt to close positions in a different order, an error will be returned. The property value is always 'false' for accounts without hedging position management (ACCOUNT_MARGIN_MODE!=ACCOUNT_MARGIN_MODE_RETAIL_HEDGING).
    • New return code: MT_RET_REQUEST_CLOSE_ONLY — the request is rejected, because the rule "Only closing of existing positions by FIFO rule is allowed" is set for the symbol

    There are three main methods to close a position:

    • Closing from the client terminal: the trader closes the position manually, using a trading robot, based on the Signals service subscription, etc. In case of an attempt to close a position, which does not meet the FIFO rule, the trader will receive an appropriate error.
    • Closing upon Stop Loss or Take Profit activation: these orders are processed on the server side, so the position closure is not requested on the trader (terminal) side, but is initiated by the server. If Stop Loss or Take Profit triggers for a position, and this position does not comply with the FIFO rule (there is an older position for the same symbol), the position will not be closed.
    • Closing upon Stop Out triggering: such operations are also processed on the server side. In a normal mode, in which FIFO-based closing is disabled, in case of Stop Out positions are closed starting with the one having the largest loss. If this option is enabled, the open time will be additionally checked for losing positions. The server determines losing positions for each symbol, finds the oldest position for each symbol, and then closes the one which has the greatest loss among the found positions.

  6. Added options for parameter grouping via "input group". This enables visual separation of parameters based on their underlying logic.

    In the below Expert Advisor code,input parameters are grouped according to their purpose:
    input group           "Signal"
    input int             ExtBBPeriod    =20;         // Bollinger Bands period
    input double          ExtBBDeviation =2.0;        // deviation
    input ENUM_TIMEFRAMES ExtSignalTF    =PERIOD_M15; // BB timeframe
    
    input group           "Trend"
    input int             ExtMAPeriod    =13;         // Moving Average period
    input ENUM_TIMEFRAMES ExtTrendTF     =PERIOD_M15; // MA timeframe
    
    input group           "ExitRules"
    input bool            ExtUseSL       =true;       // use StopLoss
    input int             Ext_SL_Points  =50;         // StopLoss in points
    input bool            ExtUseTP       =false;      // use TakeProfit
    input int             Ext_TP_Points  =100;        // TakeProfit in points
    input bool            ExtUseTS       =true;       // use Trailing Stop
    input int             Ext_TS_Points  =30;         // Trailing Stop in points
    
    input group           "MoneyManagement"
    sinput double         ExtInitialLot  =0.1;        // initial lot value
    input bool            ExtUseAutoLot  =true;       // automatic lot calculation
    
    input group           "Auxiliary"
    sinput int            ExtMagicNumber =123456;     // EA Magic Number
    sinput bool           ExtDebugMessage=true;       // print debug messages
    When such an Expert Advisor is launched in the Strategy Tester, input parameter blocks can be collapsed or expanded by a double click on the group name, as well as all parameters within a group can be selected for optimization with a single check box.




  7. Fixed import of DLL functions with names matching MQL5 function names. Example:
    #import "lib.dll"
    int func();
    #import
    //+------------------------------------------------------------------+
    //|                                                                  |
    //+------------------------------------------------------------------+
    int func()
      {
       return(0);
      }
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
      {
       Print( func() );
      }
    In earlier versions, the following error returned during compilation:
    'func' - ambiguous call to overloaded function with the same parameters
    could be one of 2 function(s)
       int func()
       int func()
    Now, instead of the error, the built-in MQL5 function with a higher priority will be used by default. The imported function can be called by explicitly specifying the scope:
    void OnStart()
      {
       Print( lib::func() );
      }
  8. Fixed specification of time in economic calendar news. Now events are delivered by taking into account the time zone of the trade server to which the terminal is connected, instead of the local computer time zone.
  9. Fixed excessive memory consumption in the Copyticks and CopyTicksRange functions.

Signals

  1. Fixed display of signal charts when working in Wine (Mac OS and Linux).

Tester

  1. Big Strategy Tester update. New start page, redesigned settings page, improved usability.

    Start page
    Now, after tester launch, instead of multiple settings the user sees a list of standard tasks, by selecting which they can quickly start testing. The new design is primarily intended for unexperienced users.

    We have selected the most frequent strategy testing and optimization tasks and we have added them in the start page. In addition, one of the previously performed tasks can be restarted from the start page. If you have run a lot of tasks and they do not fit into the start page, use the search bar. You can find a test by any parameter: program name, symbol, timeframe, modeling mode, etc.




    Hiding irrelevant parameters
    After selecting a task, the user proceeds to further testing parameters: selection of an Expert Advisor, symbol, testing period, etc. All irrelevant parameters which are not required for the selected tasks are hidden from the setup page. For example, if mathematical calculations are selected, only two parameters should be specified: selection of a program to be tested and the optimization mode. Testing period, delay and tick generation settings will be hidden.




    Convenient testing setup
    For convenience some of the parameters on the setup page have been rearranged. Extended explanations have been added for the delay and visualization parameters. In addition, testing settings can now be saved and uploaded manually, and thus a trader can quickly return to previous settings.




    Using the same tab you can quickly open the program for editing in MetaEditor.

    Profit calculation in pips
    Using the settings, you can enable profit calculation in pips. This mode accelerates testing while there is no need to recalculate profit to deposit currency using conversion rates (and thus there is no need to download the appropriate price history). Swap and commission calculations are eliminated in this mode.




    Please note that when calculating profit in pips, the deal volume does not matter. Only the number of won/lost pips is calculated for each deal. Also margin control is not performed in this mode. Use it only for quick and rough strategy estimation and then check the obtained results using more accurate modes.

    General improvements
    Testing start/stop button and progress bar have been moved to the tabs bar. Thus, the user can control the process from any Strategy Tester section. Testing start/stop commands have also been added to context menus of settings and inputs sections.




  2. The optimization chart can now be displayed in the main working area of the terminal, instead of displaying in a separate strategy tester section. This way, much more space becomes available for data analysis. The 3D visualization system has also been updated.

  3. Added saving of optimization cache for the "All symbols in Market Watch" mode.
  4. Added saving of test cache.

    In earlier versions, executed task results were saved to files only when optimizing Expert Advisors. Now, cache files are also saved during single tests, using which users can return to previous calculations and view statistics, balance, equity and deposit loading graphs, at any time. In future releases, this option will enable comparison of testing results.

    To load previous test results, use the new Tester start page: click "Previous results" and select the desired site:




  5. Significantly accelerated testing and optimization, including operations performed using the MQL5 Cloud Network.
  6. Fixes and optimized operations with frames.

MetaEditor

  1. Added ability to configure code styler.

    The MetaEditor includes a built-in code styler, which enables automatic formatting of program text in accordance with the adopted standard. Now in addition to common style, you can use other popular standards. To do this, open MetaEditor settings and select the desired style:




    The following parameters can be additionally set for the styler:

    Spaces per indent
    Sets the number of spaces used in aligning of nested constructions:
    if(condition)
      {
       //---
      }

    Replace tabs with spaces
    If this option is enabled, the styler will replace all tabs in the code with spaces. The number of characters per tab is set in the General section.

    Delete empty lines
    When this option is enabled, the styler will delete all lines having only a line break character.

    Insert spaces after commas and semicolons
    When this option is enabled, the styler will visually separate constructions with element enumerations. Example:
    // before styling
    ParameterGetRange("InpX",enable,x_cur,x_start,x_step,x_stop);
    // after styling
    ParameterGetRange("InpX", enable, x_cur, x_start, x_step, x_stop);

    Insert spaces around declaration operators
    When this option is enabled, the styler will insert spaces around the assignment, equality, comparison, and other operators. Example:
    // before styling
    if(x==1&y!=2)
      {
       int a=0;
      }
    // after styling
    if(x == 1 & y != 2)
     {
      int a = 0;
     }

  2. "Show in Navigator" command has been added to the file bookmarks context menu. Thus, the user can easily find a file opened for editing among the editor's folder structure.




  3. Fixed display of the 'union' keyword in tooltips.

The user interface has been additionally translated into 18 new languages:

  • European Region — Swedish, Lithuanian, Danish, Latvian, Estonian, Serbian, Slovenian, Slovak, Finnish, Georgian
  • Asian region — Javanese, Marathi, Bengali, Punjabi, Tamil, Telugu
  • African Region — Swahili, Hausa

The platform interface is now available in 50 languages, which are spoken by more than 4 billion people.

To set you language for the interface, navigate to the "View / Language" menu at the top of the terminal.

Documentation has been updated.

Fixes based on crash logs.

The update will be available through the Live Update system.

12 June 2019
MetaTrader 5 platform build 2085: Integration with Python and Strategy Tester improvements

Terminal

  1. Added new API which enables request of MetaTrader 5 terminal data through applications using Python language.

    Python is a modern high-level programming language for developing scripts and applications. It contains multiple libraries for machine learning, process automation, as well as data analysis and visualization.

    MetaTrader package for Python is designed for efficient and fast obtaining of exchange data via interprocessor communication, directly from the MetaTrader 5 terminal. The data received via this pathway can be further used for statistical calculations and machine learning.



    Connection

    1. Download the latest Python version at https://www.python.org/downloads/windows
    2. During Python installation, check "Add Python X.X to PATH%" to enable the launch of Python scripts from the command line.
    3. Install the MetaTrader 5 module from the command line
      pip install MetaTrader5
    4. Add matplotlib and pytz packages
      pip install matplotlib
      pip install pytz

    Functions

    • MT5Initialize establishes connection with the MetaTrader 5 terminal
    • MT5Shutdown closes the previously established connection to the MetaTrader 5 terminal
    • MT5TerminalInfo receives status and parameters of the connected MetaTrader 5 terminal
    • MT5Version returns the MetaTrader 5 terminal version
    • MT5WaitForTerminal waits till the MetaTrader 5 terminal connects to the trade server
    • MT5CopyRatesFrom receives bars from the MetaTrader 5 terminal starting from the specified date
    • MT5CopyRatesFromPos receives bars from the MetaTrader 5 terminal starting from the specified index
    • MT5CopyRatesRange receives bars in the specified date range from the MetaTrader 5 terminal
    • MT5CopyTicksFrom receives ticks from the MetaTrader 5 terminal starting from the specified date
    • MT5CopyTicksRange receives ticks for the specified date range from the MetaTrader 5 terminal


  2. The Market and Signal sections have been optimized. Now the product and signal showcases run up to seven times faster and thus provide a better service browsing experience.




  3. Added support for "Market", "Signals" and "Search" in Wine. Linux and Mac OS users can now access the largest store of trading applications along with the copy trading service.




  4. The built-in learning program has been translated into more than 30 languages, including Spanish, Chinese, Portuguese and German, among others. To view interactive tips in the desired language, switch to the required interface language using the View menu.




  5. New options enable verification of phone numbers and emails, which are specified by traders when opening demo and preliminary accounts.

    The need for data verification is determined by the broker. If the option is enabled, confirmation codes are automatically sent to the trader during an account request and special code fields appear in the dialog box:




    Confirmation codes are valid for several minutes. If the code is not entered in the field within this time frame, the trader will need to repeat the procedure.
    Before sending codes, the system checks whether the specified phone/email was previously confirmed. If the trader has already passed verification from his or her computer, an account will be opened without additional confirmation. Thus, there will be no additional burden for traders during an account request.

  6. MQL5.community payment options through the PayPal system have been expanded. Purchases can now be performed with one click, using this system.

    How it works
    After you log in using your PayPal account when making a purchase, you will be requested to allow further payments to our company:





    By confirming this option, and you will be able to perform further purchases with one click, by pressing the previously saved account button:




    If you click "Cancel and return to MetaQuotes Software Corp.", you will make the payments in a normal way, by entering the PayPal account details manually, for each purchase.
    The MQL5.com website and the MetaTrader 5 platform do not store your payment details. When you deposit funds, make a purchase in the Market service or subscribe to a Signal, the data verification is performed on the payment system side.
    You can always remove your PayPal account link.

  7. Strategy Tester improvements and optimization.

    We have introduced a large number of hidden improvements and fixed errors to optimize the Strategy Tester operation. The update enables much faster testing for some of the task types and higher operation stability. Major improvements include:

    Operations with frames
    Operations with frames on local, network and cloud agents have been optimized. Such operations are now processed faster and are never skipped.

    Distribution of tasks to agents
    The tester can now redistribute tasks to agents during the optimization process. If a new agent has become available (or one of the previously used ones has been released), the tester automatically creates a new package of tasks, using those which were earlier distributed among other agents. Tasks can also be redistributed if slow agents are detected. Tasks of such agents are sent to other agents to complete the optimization faster.

    Task distribution in math calculation mode has become much faster.

    Optimization statistics in the Journal
    Optimization logging has been extended: it includes detailed statistics related to the MQL5 Cloud Network usage and to the enabling and disabling of cloud agents, among others.

    Operation in full optimization log mode
    For optimal resource consumption, not all messages from agents are recorded to the tester log. To view all logs, you can enable the "Full optimization logs" option using the tester log context menu. Previously, this mode significantly slowed the optimization process. Now the calculation time is not affected.

    MQL5 Cloud Network
    Optimized operation of cloud testing agents. Now computation tasks are distributed more efficiently.

  8. The built-in calendar features publications of more than 900 indicators related to the 18 largest global economies, including US, European Union, Japan and the UK, among others. Relevant data is collected from open sources in real time. By regularly checking the service, traders remain informed on the latest global news and can take informed trading decisions.

    The economic calendar is available in desktop terminals and websites, as well as on mobile devices. The application can be opened using the Calendar context menu in the terminal:




    Select your platform and download the Tradays apps:


    In addition to calendar functions available in the desktop platform, the mobile version provides event reminders and access to a complete history of indicators in the form of charts and tables.

  9. Added automatic generation of custom symbol bar history during import of tick history. Now, if tick data of a custom symbol changes, corresponding bars are automatically recalculated:

    • Thus, unified data is preserved in the platform.
    • After importing tick data (provided that there is enough data), there is no need to import bars since they are automatically calculated by the terminal.

    Changes concern the import of ticks performed via the terminal interface, as well as the update of ticks performed from MQL5 applications using the CustomTicks* function. Any changes in tick data lead to recalculation of the corresponding 1-minute bars of the custom symbol.

  10. Fixed data update in the Data Window when using a crosshair on a detached chart.
  11. Fixed tick history saving. In earlier versions, multiple ticks within a millisecond could be saved in the wrong order.
  12. Fixed generation of charts based on a too short price history (less than a day) available on the server.

MQL5

  1. Added MQL5 service debugging option. These applications can now be tested similar to Expert Advisors and indicators.
  2. New profit and margin calculation modes have been added in the ENUM_SYMBOL_CALC_MODE enumeration:

    • SYMBOL_CALC_MODE_EXCH_BONDS — calculation for exchange bonds.
    • SYMBOL_CALC_MODE_EXCH_STOCKS_MOEX — calculation for the stocks traded on the Moscow Exchange.
    • SYMBOL_CALC_MODE_EXCH_BONDS_MOEX — calculation for the bonds traded on the Moscow Exchange.

  3. The new TesterDeposit function enables the emulation of deposit operations during testing. The function can be useful when testing money management strategies.
    bool  TesterDeposit(
       double money      // the deposit amount
       );
  4. During the OnDeinit method execution, the MQL5 application does not receive any events from the terminal. Previously, applications occasionally failed to complete de-initialization (for example, to delete all created objects) due to the receiving of other events.
  5. Fixed occasional errors which could occur after a change in the custom symbol tick history for the current day.
  6. Fixed occasional application slowdown when using a large number (tens of thousands) of graphical objects.
  7. Fixed terminal freezing in the case of frequent trading history calls from MQL5 programs.
  8. Fixed iBarShift function operation. With the "exact=false" flag and request outside the data, the function returned the oldest bar number instead of the newest one.

Tester

  1. Fixed determination of the cores number on computers with processors having several NUMA nodes.
  2. Added possibility to run testing and optimization with the zero initial deposit, since deposit operations can be emulated during testing using the new TesterDeposit function.

MetaEditor

  1. The code styler command can now be added to the toolbar for quick access.
  2. Fixed switching to parameter definition and viewing of related data when using non-Unicode characters in function and variable names.

Documentation has been updated.

The update is available through the LiveUpdate system.

12345678910111213