What's new in MetaTrader 5

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

4 October 2024
MetaTrader 5 Platform build 4585: Performance improvements

Terminal

  • Fixed crashes that could occur under certain conditions while stopping profiling of MQL5 programs.

MetaEditor

MetaTester

  • Fixed crashes that occurred under certain conditions when re-running single pass tests.
27 September 2024
MetaTrader 5 build 4570: Enhancements to the Web version and OpenBLAS integration in MQL5

Terminal

  1. Restricted access to MQL5 trading and history functions if the account is subscribed to a signal.

    When a signal subscription is detected on the account (regardless of whether copying is enabled in the current terminal), any MQL5 trading function calls are prohibited, including receiving open orders and positions, receiving history, and performing trading operations. A corresponding warning is logged in the journal:
    'XXX': signal subscription detected, trading and history access functions in MQL5 and Python disabled
    The restrictions also apply to Python trading functions: positions_total, positions_get, orders_total, orders_get, history_orders_total, history_orders_get, history_deals_total, history_deals_get, order_check, and order_send.

    If a signal subscription is canceled on the account or you connect to another account without a signal subscription, the restriction is lifted, and the following message is logged:
    'XXX': no signal subscription detected, trading and history access functions in MQL5 and Python enabled
    If the restriction is active on the account, MQL5 functions will return the following response codes:

    • OrderSend and OrderSendAsync return RET_REQUEST_AT_DISABLED_CLIENT
    • OrdersTotal and PositionsTotal return 0
    • PositionGetSymbol, PositionSelect, PositionSelectByTicket, and PositionGetTicket return ERR_MQLAPI_TRADE_POSITION_NOT_FOUND
    • OrderGetTicket and OrderSelect returns ERR_MQLAPI_TRADE_POSITION_NOT_FOUND
    • HistorySelect returns ERR_MQLAPI_TRADE_DEAL_NOT_FOUND

  2. Fixed, optimized and accelerated tick history request and export to CSV\HTML files.
  3. Added Microsoft Edge WebView2 support for displaying HTML content in the trading platform on macOS. Compared to the outdated MSHTML, the new component significantly expands content displaying capabilities by providing access to modern technologies. The transition to WebView2 improves the appearance of Market, Signals, VPS, and other sections, increasing their performance and creating more responsive interfaces.

  4. Fixed context menu in the internal mail sending window.
  5. Fixed filtering in the trading instrument selection dialog. It is no longer necessary to first input instrument names to hide expired instruments.
  6. Fixed calculation of margin requirements in the contract specification window. The error occurred for Exchange Stocks and Bonds instruments.
  7. Improved bulk position closing function for FIFO accounts. Incompatible operation types are no longer displayed for such accounts, including closing of all profitable/losing positions, same-directed positions and opposite positions.
  8. Fixed issue where users could not place opposite pending orders on accounts where position closing follows the FIFO rule.
  9. Fixed calculation of liquidation value for accounts with positions on Exchange Futures instruments.
  10. Fixed floating profit calculations for positions on Exchange Bonds and Exchange MOEX Bonds instruments.
  11. Disabled automatic demo account creation when the platform is launched without previously added accounts.
  12. Improved name and email validation when registering accounts.
  13. Fixed margin calculation for hedged positions. The error could occur in certain cases when using floating margin on the account (calculated based on the volume/value of current positions).
  14. Fixed updating the "Next" button state in the demo account opening dialog. After entering the phone or email confirmation code, the button could remain inactive under certain conditions.
  15. Updated user interface translations.

MQL5

  1. Added native integration with the OpenBLAS matrix computation library.

    OpenBLAS is a high-performance open-source linear algebra library that implements BLAS (Basic Linear Algebra Subprograms) and some LAPACK functions. OpenBLAS is designed to improve computational performance, particularly in matrix and vector operations, which are often used in scientific and engineering tasks such as machine learning, numerical methods, and simulations.

    Key features of OpenBLAS:

    • Multithreading support: OpenBLAS can efficiently use multiple processor cores for parallel computations, significantly accelerating operations on multiprocessor systems.
    • Optimization for processor architectures: OpenBLAS includes optimized builds for various processors such as Intel, AMD, ARM and others. The library automatically detects processor characteristics (supported instruction sets like AVX/AVX2/AVX512) and selects the most suitable function implementations.
    • Extensive BLAS operation support: OpenBLAS implements core BLAS functions, including vector operations (e.g., vector addition and dot product), matrix operations (multiplication), and vector-matrix operations.
    • LAPACK compatibility: The library supports LAPACK (Linear Algebra PACKage) functions for more complex linear algebra operations, such as solving systems of linear equations, calculating matrix eigenvalues, and others.
    • High performance: Compared to other BLAS libraries, OpenBLAS often demonstrates better results due to hand-crafted optimizations for specific processor architectures.

    OpenBLAS is widely used in applications involving numerical computations:

    • Training neural networks and other machine learning tasks.
    • Scientific computing (e.g. modeling of physical processes).
    • Processing and analyzing large amounts of data.

    The following methods are currently available in MQL5:

    Singular value decomposition:

    • SingularValueDecompositionDC – divide-and-conquer algorithm; considered the fastest among other SVD algorithms (lapack function GESDD).
    • SingularValueDecompositionQR – QR algorithm; considered a classical SVD algorithm (lapack function GESVD).
    • SingularValueDecompositionQRPivot – QR with pivoting algorithm (lapack function GESVDQ).
    • SingularValueDecompositionBisect – bisection algorithm (lapack function GESVDX).
    • SingularValueDecompositionJacobiHigh – Jacobi high level algorithm (lapack function GEJSV).
    • SingularValueDecompositionJacobiLow – Jacobi low level algorithm (lapack function GESVJ). The method computes small singular values and their singular vectors with much greater accuracy than other SVD routines in certain cases.
    • SingularValueDecompositionBidiagDC – divide-and-conquer algorithm for bidiagonal matrices (lapack function BDSVDX).
    • SingularValueDecompositionBidiagBisect – bisection algorithm for bidiagonal matrices (lapack function BDSVDX).

    Eigen methods:

    • EigenSolver – compute eigenvalues and eigenvectors of a regular square matrix using the classical algorithm (lapack function GEEV).
    • EigenSymmetricDC – compute eigenvalues and eigenvectors of a symmetric or Hermitian (complex conjugate) matrix using the divide-and-conquer algorithm (lapack functions SYEVD, HEEVD).

    Detailed documentation will be provided soon.

  2. Added the SYMBOL_SWAP_MODE_CURRENCY_PROFIT value in the ENUM_SYMBOL_SWAP_MODE enumeration. If the SymbolInfoInteger function returns this value, swaps on the account are charged in the profit calculation currency.
  3. Expanded ONNX Runtime support. Added new types of machine learning operations, allowing you to run more advanced neural models.
  4. We continue transition to a more efficient MQL5 compiler, which is already used for some functions. The transition will allow for further optimizations and faster program execution.
  5. Added new data types to support the OpenBLAS library:

    • complexf – complex number represented by float data
    • vectorcf – vector containing elements of type complexf
    • matrixcf – matrix containing elements of type complexf

  6. Improved WebRequest operations when working with websites that violate URL formatting rules, contain redirect errors or have long lists of alternative DNS names.
  7. Fixed simultaneous assignment of matrix or vector types to multiple variables.

MetaEditor

  1. Updated available models for the AI Assistant. The more advanced GPT-4o mini now replaces GPT-3.5 Turbo. Also added the 01-mini model.
  2. Fixed debugger error due to which variable values could fail to update in the watch window.
  3. Updated user interface translations.

MetaTester

  1. Fixed saving of margin coefficients in custom symbol settings.
  2. Fixed memory leaks that could occur between testing passes under certain conditions.

Web Terminal

  1. Added Crosshair mode for viewing precise values and measuring distances on charts.

    Enable the mode by clicking the relevant button on the left panel. Move the crosshair over any point on the chart to see the date and price on the respective axes. To measure distance, click on any point on the chart and drag the cursor to another point while holding the mouse button.




    You can also use shortcuts: press the middle mouse button to enable crosshair and use Esc or right-click to disable it.

  2. Added a simple line chart constructed on bar closing prices:




  3. In the mobile view, added ability to display additional columns in the Market Watch section. To configure, switch to the table mode and click "...":




  4. Added hotkeys:

    • Home – scroll to the beginning of the chart (earliest date)
    • End – scroll to the end of the chart (latest date)
    • Page Up – scroll the chart one screen back
    • Page Down – scroll the chart one screen forward

  5. Enhanced data security for account connection storage.
  6. Improved chart scrolling, dragging, and scaling functionality.
  7. Accelerated initial loading of the web platform on the page.
  8. Optimized loading of bars.
  9. Fixed floating profit calculations for positions on Exchange Bonds and Exchange MOEX Bonds instruments.
  10. Fixed volume input on the one-click trading panel on charts.
  11. Fixed error in updating the order volumes in the Depth of Market. Values could have been delayed in updating under certain conditions.
  12. Fixed minimum allowable trading volume check when placing orders.
  13. Fixed margin calculation for hedged positions. The error could occur in certain cases when using floating margin on the account (calculated based on the volume/value of current positions).
  14. Fixed error where the Buy and Sell buttons on the one-click trading panel could become inactive until the volume was changed.
21 June 2024
MetaTrader 5 Platform build 4410: Performance improvements
MetaTrader 5 Platform build 4410: Performance improvements

Terminal

  • Fixed terminal crash, which could occur upon testing start under certain conditions.

MQL5

Web Terminal

  1. Fixed validation of browser compatibility with the web terminal. In some cases, users might have erroneously received a message indicating that their browser was not supported.
  2. Fixed opening of demo accounts.
  3. Minor fixes and improvements.

The update will be available through the Live Update system.

MetaTrader 5 Android

  1. Completely redesigned interface for the tablet versions. It now features a modern design, already proven on the iOS and web versions of the platform. The main sections are now located at the bottom of the screen, and chart operation commands appear are available on the left.




  2. Added context menu to the position history section, allowing quick access to the trading dialog or chart of the corresponding symbol.
  3. Hidden command switching to the trading dialog for non-tradable symbols.
  4. Fixed operation with the MetaQuotes-Demo server.

Update your mobile apps through Google Play, Huawei AppGallery or by downloading the APK file.

7 June 2024
MetaTrader 5 Platform build 4380: Performance improvements

Terminal

  1. Fixed errors which could cause incorrect operation of the Live Update system under certain conditions.
  2. Added new hotkey, Alt+X, to open a list of Expert Advisors.
  3. Fixed errors reported in crash logs.

MetaTester

  1. Fixed errors in setting certain properties of the Bitmap graphic object.
  2. The connection of testing agents to the MQL5 Cloud Network is now prohibited when operating in virtual environments and when the processor does not support the AVX instruction set.

Web Terminal

  1. Fixed error in the operation of the one click trading panel on the chart.
  2. Fixed warning dialog that opens when you enable the one click trading panel on the chart.
31 May 2024
MetaTrader 5 Build 4350: More analytical objects in the Web platform and Welcome page in MetaEditor

MetaEditor

  1. Added Welcome page to assist users in starting their journey with algorithmic trading and application development.



    Materials for beginners
    The "Introduction" section presents educational materials available on MQL5.com: language documentation, books, articles, developer forums and code base library. It also introduces services where you can apply and monetize your knowledge: the applications market, freelance and trading signals.

    In the documentation and books sections, you can find a more detailed description of the available learning materials.

    Useful features for developers
    The "What's New" section offers a collection of essential information to keep developers up-to-date:


    Additionally, you will find here a list of recently opened files for quick access.



    For users actively selling their applications in the Market, the "My Sales" report offers an invaluable tool for assessing their performance. It provides access to:

    • Comprehensive sales and download statistics over time.
    • Sales geography, offering insights into regions where your products have the highest popularity. This can suggest ideas for further project expansion, such as localization into specific languages or targeted advertising campaigns in particular regions.
    • Data on top-selling products based on sales volume and revenue generated. The graph can be filtered based on license type: full or rental for a certain duration. Additionally, you can see here a graph with product price changes. All of this will help you understand your customers.
    • Detailed download and sales statistics for each product.


  2. Improved built-in search. The top search bar is now used exclusively for searching text within the current document or in local files. For a global search through educational materials and codes, use a separate section in the Toolbox.


  3. Added support for GPT-4o, the latest ChatGPT model, in AI Assistant. It can be used to automatically complete code and get hints. You can select the new model in the MetaEditor settings.


  4. Updated user interface translations.

Terminal

  1. Increased precision in displaying the calculation price in the trading instrument specification.
  2. Added the hotkey Alt+X to open the list of Expert Advisors.
  3. Fixed MFE and MAE calculations in the trading report.
  4. Fixed saving and restoring of economic calendar filtering settings by country and currency.
  5. Fixed application of templates to charts. Now, if the display of trading history is enabled for the chart, the corresponding objects will not disappear after applying a template.
  6. Fixed errors in the options board. The addition of symbols to the board could cause the platform to freeze under certain conditions.
  7. Fixed error in the position editing dialog. In some cases, incorrect levels could be entered instead of the current Stop Loss and Take Profit values.
  8. Updated user interface translations.

MQL5

  1. Optimized and accelerated the ArrayResize function. The function can be executed up to 40% faster under certain conditions.
  2. Updated support for ONNX.
  3. Fixed MessageBox function calls in service applications. Regardless of the button pressed by the user in the dialog, the function returned a null value.
  4. Fixed error that, in some cases, caused incomplete initialization of MQL5 programs.
  5. Fixed error parsing some macros. The error occurred when using a large number of constants.


MetaTrader 5 Web Terminal

  1. Extended list of available analytical objects. Now, you can utilize the ruler to measure time and prices, draw shapes (rectangle, ellipse, triangle, and circle), and add labels to your charts. All objects can be found in the left panel:


  2. Added ability to rename objects.
  3. Improved integration with the economic calendar. Optimized and accelerated data requests.
  4. Accelerated chart operations.
  5. Accelerated application start and connection to a trading account.
  6. Fixed setting that controls the display of trading operations on the chart.
  7. Fixed display of margin requirements in contract specifications.
  8. Fixed display of account statuses in the history section. Issues could occur on devices with narrow screens.
  9. Fixed display of the Depth of Market changes.
22 March 2024
MetaTrader 5 build 4260: General improvements

Terminal

  1. Fixed errors in subscribing to free products in the Subscriptions service. The relevant button might not be displayed in the dialog under certain conditions.
  2. Updated translations of the user interface.

MQL5

  1. Expanded support for keyboard events:

    • Added CHARTEVENT_KEYUP event for the OnChartEvent handler. It allows the tracking of events related to key releases.
    • Added processing of Dead keys. These are the keys that modify the appearance of the character generated by the key struck immediately after. For example, in the Greek layout, a stressed vowel ά, έ, ύ, etc., can be generated by first pressing ";" and then the vowel. The pressing of such keys can be tracked using the TranslateKey function.
    • Improved TranslateKey and TerminalInfoInteger functions. Now, when receiving CHARTEVENT_KEYUP or CHARTEVENT_KEYDOWN events in OnChartEvent, you can obtain the complete keyboard state at the time the event occurred. For example, if the user pressed the Z key, you will be able to determine whether the Ctrl or Shift key was pressed at that moment. For other events, the functions will continue to operate as before, returning the keyboard state at the current moment.

  2. Updated the Alglib library. Following the update, the following methods in the CMatrixDouble and CMatrixComplex classes have been modified:
    vector<double/complex> operator[](const int i) const;
    vector<double/complex> operator[](const ulong i) const;
    They have been replaced by a single method with a constant return value:
    const vector<double/complex> operator[](const ulong i) const;
    This modification will assist in capturing incorrect use of the result in place as in the new Alglib version, the code mat[row][col]=x operates differently from the old version. Previously, this indicated writing to a matrix. Now, the value is written to a temporary object vector<double/complex>, which is immediately destroyed after recording.

    Adding const to the return value enables the use of mat[row][col]=x. Because mat[row] now returns a constant vector, attempting to overwrite its element with mat[row][col] will result in a compilation error.

  3. Fixed error that could cause the incorrect operation of ChartGet* functions under certain conditions.

MetaEditor

  1. Added search through the contents of the book Neural Networks for Algorithmic Trading in MQL5. The new option appears in the same section as the previously published book MQL5 Programming for Traders.



Tester

  1. Fixed optimization when using a large number of remote agents. In some cases, the error could cause excessive CPU usage.


MetaTrader 5 Web Terminal

  1. Fixed setting of limit orders for instruments with the exchange execution mode. Now, when the price of the order being placed changes relative to the current price (becomes higher or lower), the order type will not switch from Buy Limit to Sell Limit and vice versa, as it does for instruments of other types. Thus, users can place Buy Limit orders above the market and Sell Limit orders below the market, ensuring that the transaction price is guaranteed to be limited.
  2. Fixed the display of selected symbol counters in the Market Watch.
7 March 2024
MetaTrader 5 build 4230: More built-in applications and expanded ONNX support

Terminal

  1. Added 28 new Expert Advisors and 12 new indicators to the standard platform package. The applications are available in the Expert Advisors\Free Robots and Indicators\Free Indicators sections in the Navigator. Each program is available as source code with detailed comments to assist you in learning the MQL5 language.

    The robots implement trading strategies based on technical indicators and candlestick patterns, such as 3 Black Crows – 3 White Soldiers, Bullish Engulfing – Bearish Engulfing, Bullish Harami – Bearish Harami and others. New indicators are implementations of popular channels: Camarilla, DeMark, Donchian, Fibonacci and Keltner, among others.

    Added 28 new Expert Advisors and 12 new indicators in the standard platform package.


  2. Preparations are underway for the launch of Nasdaq market data subscriptions. Right from the platform, traders will be able to access real-time quotes and deep price histories for hundreds of financial instruments from one of the largest exchanges. Subscriptions will be available to any user having a demo account on the MetaQuotes-Demo server and an MQL5.community account.

    Nasdaq Market Data Subscription


    To get started, you only need to purchase a subscription and add the relevant symbols to your Market Watch. You can use these symbols as regular instruments: open charts, analyze them using objects and indicators, and run Expert Advisors in the strategy tester. Access to all information is implemented as for ordinary financial instruments with which you work with a broker.

  3. Improved margin section in the instrument specification. The section now features margin rates and calculated values for each instrument.


    Improved margin section in the instrument specification


    Fixed errors in margin display for certain types of symbols.

  4. Added link to the MQL5 Telegram channel in the Help menu. Interesting content for developers is regularly shared in the channel, including reviews of new programming articles and free robots and indicators from the Code Base. Subscribe to the channel and ensure you don't miss out on important information.

    Added link to the MQL5 Telegram channel in the Help menu.


  5. Added support for the ShutdownTerminal parameter in the [StartUp] section of custom configuration files. Use this parameter to launch the platform to execute one-off tasks using scripts. For example, you have a script that takes a screenshot of the chart. You can create a configuration file that launches this script along with the platform. If you add ShutdownTerminal set to 'Yes' to this file, the platform will automatically shut down immediately after the script completes.
  6. Enhanced protection of network protocols and Market products.
  7. Disabled support for the Signals service for demo accounts. To access enhanced statistics on your training accounts, use the new trading report. It features a plethora of metrics characterizing your strategy profitability and risks, including growth, balance and equity graphs, diagrams of trade distribution by direction and instruments, and much more.
  8. Fixed display of broker agreement links in the Help menu.
  9. Improved selection of the best server when renting VPSs.
  10. Fixed refreshing of the subscriptions page when switching between sections in the Navigator.
  11. Fixed updating of the list of agreements when opening a preliminary account.
  12. Updated translations of the user interface.

MQL5

  1. Added MQL_STARTED_FROM_CONFIG property in the ENUM_MQL_INFO_INTEGER enumeration. Returns true if the script/Expert Advisor was launched from the StartUp section of the configuration file. This means that the script/Expert Advisor had been specified in the configuration file with which the terminal was launched.
  2. We continue expanding support for ONNX models.

    Machine learning tasks do not always require greater computational accuracy. To speed up calculations, some models use lower-precision data types such as Float16 and even Float8. To allow users to input the relevant data into models, the following functions have been added to MQL5:
    bool ArrayToFP16(ushort &dst_array[],const float &src_array[],ENUM_FLOAT16_FORMAT fmt);
    bool ArrayToFP16(ushort &dst_array[],const double &src_array[],ENUM_FLOAT16_FORMAT fmt);
    bool ArrayToFP8(uchar &dst_array[],const float &src_array[],ENUM_FLOAT8_FORMAT fmt);
    bool ArrayToFP8(uchar &dst_array[],const double &src_array[],ENUM_FLOAT8_FORMAT fmt);
    
    bool ArrayFromFP16(float &dst_array[],const ushort &src_array[],ENUM_FLOAT16_FORMAT fmt);
    bool ArrayFromFP16(double &dst_array[],const ushort &src_array[],ENUM_FLOAT16_FORMAT fmt);
    bool ArrayFromFP8(float &dst_array[],const uchar &src_array[],ENUM_FLOAT8_FORMAT fmt);
    bool ArrayFromFP8(double &dst_array[],const uchar &src_array[],ENUM_FLOAT8_FORMAT fmt);
    Since real number formats for 16 and 8 bits may differ, the "fmt" parameter in the conversion functions must indicate which number format needs to be processed. For 16-bit versions, the new enumeration NUM_FLOAT16_FORMAT is used, which currently has the following values:

    • FLOAT_FP16 – standard 16-bit format also referred to as half.
    • FLOAT_BFP16 – special brain float point format.

    For 8-bit versions, the new ENUM_FLOAT8_FORMAT enumeration is used, which currently has the following values:

    • FLOAT_FP8_E4M3FN – 8-bit floating point number, 4 bits for the exponent and 3 bits for the mantissa. Typically used as coefficients.
    • FLOAT_FP8_E4M3FNUZ — 8-bit floating point number, 4 bits for the exponent and 3 bits for the mantissa. Supports NaN, does not support negative zero and Inf. Typically used as coefficients.
    • FLOAT_FP8_E5M2FN – 8-bit floating point number, 5 bits for the exponent and 2 bits for the mantissa. Supports NaN and Inf. Typically used for gradients.
    • FLOAT_FP8_E5M2FNUZ — 8-bit floating point number, 5 bits for the exponent and 2 bits for the mantissa. Supports NaN, does not support negative zero and Inf. Also used for gradients.

  3. Added new matrix and vector methods used in machine learning:

    • PrecisionRecall computes values to construct a precision-recall curve. Similarly to ClassificationScore, this method is applied to a vector of true values.
    • ReceiverOperatingCharacteristic — computes values to construct the Receiver Operating Characteristic (ROC) curve. Similarly to ClassificationScore, this method is applied to a vector of true values.

  4. ONNX Runtime updated to version 1.17. For release details, please see GitHub.
  5. Python integration package updated to version 5.0.4200, added support for Python 3.12. Update your package using the command "pip install --upgrade MetaTrader5" to get the latest changes.
  6. Added DEAL_REASON_CORPORATE_ACTION property in the ENUM_DEAL_REASON enumeration. It indicates a deal executed as a result of a corporate action: merging or renaming a security, transferring a client to another account, etc.
  7. Added support for comparing complex vectors and matrices for the Compare method. The comparison involves estimating the distance between complex numbers. The distance is calculated as sqrt(pow(r1-r2, 2) + pow(i1-i2, 2) and is a real number that can already be compared with epsilon.
  8. Fixed conversion of color type variables to text in RGB format.
  9. Fixed returning of the result of obtaining eigenvectors in the Eig method in the case of a complex eigenvalue. Added method overload for complex evaluation.
  10. Fixed OrderCalcMargin function operation for certain cases.

MetaEditor

  1. Added link to the recently released book "MQL5 Programming for Traders" in the Help\MQL5.community menu. The book has also been added to the search system, and thus you can find the necessary information directly from MetaEditor:

    Added search for the book "MQL5 Programming for Traders"



  2. Built-in search improvements:

    • The search results section in the Toolbox window has been divided into two tabs: "Search" for online search results (documentation, articles, book, etc.) and "Search in files" for local results.
    • A separate search string has been added to the results section. You can use it instead of the search bar in the main MetaEditor toolbar.

  3. Added support for AVX, AVX2 and AVX512 modes when compiling commands from the command line. To compile, add one of the following keys to your command: /avx, /avx2 or /avx512.
  4. SQLite engine for database operations updated to version 3.45.
  5. Disabled support for Internet Explorer. Now only Microsoft Edge WebView2 is used to display HTML pages. Compared to the outdated MSHTML, the new component significantly expands content displaying capabilities by providing access to the latest technologies. The use of WebView2 improves the appearance of some MetaEditor sections, increases performance, and creates a more responsive interface.
  6. Fixed freezing that occurred in rare cases on function autocompletion.

Tester

  1. Fixed calculations of triple swaps if the test start day falls on the triple-swap day.

MetaTrader 5 Web Terminal

Improved display of margin requirements in contract specifications. Now, in addition to ratios and initial parameters for calculations, specifications display the final margin values. If the margin amount depends on the position volume, the corresponding levels will be shown in the dialog.


Improved display of margin requirements in contract specifications


The margin is calculated based on the instrument price at the time the specification window opens and is not updated in real time. Therefore, the values should be considered indicative. To recalculate values based on current prices, reopen the instrument specification.

18 January 2024
MetaTrader 5 build 4150: Trading report export and new machine learning methods in MQL5

Terminal

  1. Added export of trading reports to HTML and PDF files. With this option, you can easily share your trading achievements with colleagues and investors. New export commands are available in the File menu and in the report menu.

    Export trading report to HTML and PDF files


  2. Added ability to save the current state of the Market Watch window to a CSV file. To do this, select Export in the context menu. The file will save the metrics that are selected at the time of export. To save more data, enable additional columns through the context menu.


    Exporting Market Watch state


  3. Improved display of margin requirements in contract specifications. Now, instead of ratios and initial parameters for calculations, specifications display the final margin values. If the margin amount depends on the position volume, the corresponding levels will be shown in the dialog.


    Improved display of margin requirements in contract specifications


    The margin is calculated based on the instrument price at the time the specification window opens and is not updated in real-time. Therefore, the values should be considered indicative. To recalculate values based on current prices, reopen the instrument specification.

  4. Disabled support for the Signals service for demo accounts. To access enhanced statistics on your training accounts, use the new trading report. It features a plethora of metrics characterizing your strategy profitability and risks, including growth, balance and equity graphs, diagrams of trade distribution by direction and instruments, and much more.
  5. Fixed display of the potential profit/loss value when editing Take Profit and Stop Loss for Stop Limit orders.
  6. Fixes and improvements related to the operation of the Payment system.
  7. Fixed duplicate checks when loading a set of symbols in the Market Watch from a *.set file.
  8. Fixed web installer for Parallels. Now, when using this virtualization system on macOS with M1/M2/M3, the platform will be installed correctly.
  9. Updated user interface translations.
  10. Fixed errors reported in crash logs.

MQL5

  1. Added new methods for operations with matrices and vectors, which are utilized in Machine Learning.

    • ConfusionMatrix — computes the error matrix. The method is applied to a vector of predicted values.
    • ConfusionMatrixMultilabel — computes the error matrix for each label. The method is applied to a vector of predicted values.
    • ClassificationMetric — computes the classification metric to evaluate the quality of the predicted data compared to the true data. The method is applied to a vector of predicted values.
    • ClassificationScore — computes the classification metric to evaluate the quality of the predicted data compared to the true data.
     
  2. Fixed data saving to a text file in the UTF-8 format using the FileWrite function.
  3. Disabled and deprecated Signal* functions. They will now return empty signal sets.

MetaEditor

  1. Increased sampling rate for profiling. The profiler now captures application states 10,000 times per second, enabling more accurate measurement of function execution rates.
  2. Updated available models in the automatic coding AI assistant. Added ChatGPT-4 Turbo model, removed outdated implementations.
  3. Fixed errors when replacing words in a selected text fragment.

Tester

  1. Fixed forward testing freezing, which could occur in generic optimization mode.
  2. Optimized and accelerated operations with the trading history from MQL5 programs.
  3. Fixed profit calculations for Close By operations. An error could occur for trading instruments not matching the main testing symbol.

Web Terminal

  1. Fixed update of trading symbol properties upon the relevant property changes on the broker's side.
  2. Fixed display of candlestick bodies on the chart. The chart could fail to display small bodies.
  3. Fixed operation of the Country field in the account opening form.
20 October 2023
MetaTrader 5 build 4040: Improvements and fixes

Terminal

  1. New trading report improvements. Fixed display of the first value on the growth graph and drawdown calculations.



  2. When opening accounts, traders receive several messages through the internal email system. They provide credentials and useful information about the platform capabilities and built-in services. We have updated and enhanced these emails, translated them into 50 languages, and completely updated the design.
  3. Optimized account deposit and withdrawal pages.
  4. Fixed volume change error when placing a new order. With some combinations of trading instrument settings, the field was not available for editing.
  5. Fixed display of broker agreement links in the demo account opening dialog.
  6. Updated user interface translations.

MQL5

  1. Fixed an error that could cause the MQL5 program to crash at startup under certain conditions.

MetaTrader 5 Web Terminal

  1. Fixed display of Stop Loss and Take Profit values in trading history.
  2. Enhanced logging. New log messages display information on successful and failed connections.
  3. Fixed context menu operation in the Market Watch.
  4. Fixed display of notifications about operation results when trading from the Depth of Market.
  5. Fixed error which caused the indicator subwindow to be removed from the chart when calling the trading dialog.
  6. Fixed on-chart dragging of trading levels displayed on top of analytical objects.
29 September 2023
MetaTrader 5 build 4000: Trading Report and Web Terminal improvements

Terminal

  1. Added display of monthly funds growth in new trading reports. To view the metrics, go to the Summary report and select the Balance mode.


    Monthly funds growth in the new trading report

  2. Fixed and improved display of the new trading report.
  3. ONNX Runtime updated to version 1.16. For release details, see GitHub.
  4. Updated user interface translations.

MetaTrader 5 Web Terminal

  1. Fixed display of password change and account opening dialogs.
  2. Fixed display of Stop Loss and Take Profit values in history. An error could occur after the modification of the relevant levels.
  3. Added scroll in the risk warning dialog.
  4. Updated user interface translations.
  5. Other improvements and fixes.
21 September 2023
MetaTrader 5 build 3980: Improvements and fixes

Terminal

  1. New trading report improvements. Fixed the display of the total swaps value and the profit chart by symbols.
  2. Optimized deposit and withdrawal pages. For further details about the new platform integration with payment systems, please read the build 3950 release notes.
  3. Optimized recalculations of financial operations across the entire platform, including the strategy tester. Now profit, margins, and many other parameters are calculated faster.
  4. Updated user interface translations.

MQL5

  1. Added Conjugate methods for complex, vector<complex> and matrix<complex> types. They implement complex conjugate operations.
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
      {
       complex a=1+1i;
       complex b=a.Conjugate();
       Print(a, "  ", b);
       /*
       (1,1)  (1,-1)
       */
    
       vectorc va= {0.1+0.1i, 0.2+0.2i, 0.3+0.3i};
       vectorc vb=va.Conjugate();
       Print(va, "  ", vb);
       /*
       [(0.1,0.1),(0.2,0.2),(0.3,0.3)]  [(0.1,-0.1),(0.2,-0.2),(0.3,-0.3)]
       */
    
       matrixc ma(2, 3);
       ma.Row(va, 0);
       ma.Row(vb, 1);
       matrixc mb=ma.Conjugate();
       Print(ma);
       Print(mb);
       /*
       [[(0.1,0.1),(0.2,0.2),(0.3,0.3)]
        [(0.1,-0.1),(0.2,-0.2),(0.3,-0.3)]]
    
       [[(0.1,-0.1),(0.2,-0.2),(0.3,-0.3)]
        [(0.1,0.1),(0.2,0.2),(0.3,0.3)]]
       */
       
       ma=mb.Transpose().Conjugate();
       Print(ma);
       /*
       [[(0.1,0.1),(0.1,-0.1)]
        [(0.2,0.2),(0.2,-0.2)]
        [(0.3,0.3),(0.3,-0.3)]]
       */
      }
  2. Added handing of ONNX model outputs of the 'Sequence of maps' type.

    For ONNX models that provide Map sequences in the output layer (ONNX_TYPE_SEQUENCE of ONNX_TYPE_MAP), a dynamic or fixed array of structures should be passed as the output parameter. The first two fields of this structure must match the ONNX_TYPE_MAP key and value types and be fixed or dynamic arrays.

    Consider the iris.onnx model created by the following Python script:
    from sys import argv
    data_path=argv[0]
    last_index=data_path.rfind("\\")+1
    data_path=data_path[0:last_index]
    
    from sklearn.datasets import load_iris
    iris_dataset = load_iris()
    from sklearn.model_selection import train_test_split
    X_train, X_test, y_train, y_test = train_test_split(iris_dataset['data'], iris_dataset['target'], random_state=0)
    from sklearn.neighbors import KNeighborsClassifier
    knn = KNeighborsClassifier(n_neighbors=1)
    knn.fit(X_train, y_train)
    
    #  Convert into ONNX format
    from skl2onnx import convert_sklearn
    from skl2onnx.common.data_types import FloatTensorType
    initial_type = [('float_input', FloatTensorType([None, 4]))]
    onx = convert_sklearn(knn, initial_types=initial_type)
    path = data_path+"iris.onnx"
    with open(path, "wb") as f:
        f.write(onx.SerializeToString())
    Open the created onnx file in MetaEditor:

    Viewing the ONNX model in MetaEditor


    The Map sequence is passed as "output_probability". It has a key of INT64 type (which corresponds to long in MQL5) and the float type value. To receive data from this output, declare the following structure:
    struct MyMap
      {
       long              key[];
       float             value[];
      };
    Here we used dynamic arrays with appropriate types. In this case, we can use fixed arrays because the Map for this model always contains 3 key+value pairs.

    Since the Map sequence is returned, an array of such structures should be passed as a parameter for receiving data from output_probability output. This array can be dynamic or fixed, in accordance with the properties of a particular model. Example:
    //--- declare an array to receive data from the output layer output_probability
    MyMap output_probability[];
    
    ...
    
    //--- model running
    OnnxRun(model,ONNX_DEBUG_LOGS,float_input,output_label,output_probability);

MetaEditor

  1. Fixed display of output types in the ONNX model viewer.

MetaTrader 5 Web Terminal build 3980

  1. Added Contact Broker section in the web terminal's main menu.
  2. Added error handling for SSL authentications. This authentication type is not supported in the web terminal. One-time passwords can be used instead.
  3. Fixed desktop platform download link in the main menu.
  4. Fixed accounts managing dialog. If the broker does not provide the demo or real account opening option, the relevant menu item will be hidden.
14 September 2023
MetaTrader 5 Build 3950: Deposits/withdrawals in the terminal and updated trading report

Terminal

  1. Added support for balance operations for depositing/withdrawing funds from a trading account directly in the client terminal.

    We have added integration of the most popular payment systems directly into the MetaTrader 5 platform, which allows brokers to provide traders with a new level of service. When depositing or topping up, simply select the method that suits you best and complete the transaction. For more convenience, traders can save selected cards so as not to enter card details each time. Brokers do not store payment details and card numbers. The payment data entered by a user is sent over a secure channel to the user-selected payment system.

    The new functionality provides traders with the opportunity to manage funds in one click without leaving the client terminal.



  2. Completely revamped the trading history report. Now it is more easy to view. We have revised the approach to presenting information and converted dry statistical reports into interactive graphs and diagrams. The work is still in progress, but you can evaluate the changes already.

    To view trading statistics, click Reports in the View menu.






    The report is divided into four tabs, each containing aggregated information:

    • Summary — trading summary: account data, overall profit and loss, deposits and withdrawals, balance, growth and dividends graphs and others.
    • Profit/Lost — data on profitable and losing trades. The parameter is divided by types of trading (manual, algorithmic and copying trades). The results can be analyzed in terms of trades or money by months and years.
    • Long/Short — dynamic ratio of purchases and sales at specified periods of time, as well as Buy and Sell profitability.
    • Symbols — analysis of trades by financial instruments. Here you will see which symbols you earn or lose on, how often you trade them, graphs of trades and monetary volumes for them.


    New reports allow you to visually evaluate trading results in a variety of aspects by simply clicking on the tabs. Histograms, graphs and diagrams are interactive and provide additional information when hovering the mouse cursor. Our designers have put much effort into making reports as simple and clear as possible. Just give them a try!

  3. Added the usage of AVX2 instructions in case they are supported by CPU. This allows for more efficient use of CPU capabilities the terminal is launched on. Now, when installing or updating, the terminal determines the CPU architecture on its own and installs the most optimal version. During the launch, the terminal sends a message (AVX/AVX2) to the log displaying the set of instructions the terminal is built for.
    Terminal	MetaTrader 5 x64 build 3914 started for MetaQuotes Software Corp.
    Terminal	Windows 10 build 19045, 20 x Intel Xeon  E5-2630 v4 @ 2.20GHz, AVX, 41 / 63 Gb memory, 58 / 280 Gb disk, UAC, GMT+2
    

    Advanced Vector Extensions (AVX) is an extension of the x86 instruction set for Intel and AMD microprocessors proposed back in 2008. Further development has led to the appearance of AVX2 and AVX-512 (2013).

  4. In addition to the two versions of MetaTrader 5 terminals on X64 and AVX, we have released the third version of the desktop terminal compiled with direct support for AVX2 commands. At the same time, ONNX models now also work with support for AVX2 commands.
  5. Added display of links to the broker's necessary regulatory documents. You can now obtain all the necessary legal information from your broker directly in the client terminal in Help / Terms & Conditions.




  6. Fixed 2FA authorization in case of the additional use of the extended authorization using certificates.
  7. Fixed display of internal mail messages when working on MacOS.
  8. Fixed display of the Signals window when working in Wine.
  9. Released new MetaTrader 4 and 5 installers for Linux.
  10. Added commands for visiting Linux and Mac terminal version download pages in Help. For traders' convenience, we have created a special section of the website with terminal versions for all platforms, as well as for trading in a browser.




  11. Fixed embedding images into internal mail.
  12. Released new MetaTrader 5 terminal installers for Mac with support for M1/M2 processors. Due to the transition to Wine 8.0.1, we strongly recommend that you remove old versions and install new ones. When using Wine versions older than 8.0.0, a message about the need for an update is displayed in the terminal log.
  13. Added "VPS Hosting Speed Up" in the network scan menu indicating the ping to your trading server. This allows you to clearly see how your network delays decrease when renting a built-in VPS.




  14. Strengthened the requirements for minimum password complexity, namely:

    • password length — at least 8 characters
    • the password must contain at least 1 character in upper and lower case, at least 1 digit and at least 1 special character.

  15. Usable links in terminal logs. Now when double-clicking on lines with https links, users are sent to their browsers and the link is opened.
  16. Fixed search for trading instruments in Market Watch. Now the symbol is first searched by name, and then by other fields: description, ISIN, etc.
  17. Fixed accounting for profit on trades when calculating the balance in account trading history reports. In some cases, the instrument type was not taken into account in the calculations.

VPS Hosting

  1. Added the ability to send and run EX5 programs compiled under the x64/AVX/AVX2 command set. Programs for AVX512 are not supported on the built-in VPS.
  2. Increased the number of locations for renting the built-in VPS up to 27. Now the selection of the closest server has become even wider.

MQL5

  1. Added control of compilation settings, including selection of extended processor instruction sets — AVX, AVX2, AVX512 and FMA3.

    Modern CPUs have a set of advanced instructions that significantly speed up mathematical calculations, but the vast majority of modern programs do not use these capabilities. We have added support for these instructions to the MQL5 language compiler, which allows for more efficient and faster code generation.

    We have also added the ability to choose which type of instructions to compile an MQL5 program with. You can specify both general settings for single programs in MetaEditor Options, and apply personal ones in project settings:



  2. Added the ENUM_AVERAGE_MODE and ENUM_CLASSIFICATION_METRIC enumerations to the Matrix and Vector Methods.
  3. Added Set method for vectors.
  4. Revised OpenCL initialization - now it is initialized by the first actual use, not by loading an MQL5 program containing OpenCL functions.
  5. Fixed an error when calling the SocketIsConnected function.
  6. Fixed delay in calling the OnDeinit method when unloading custom indicators.
  7. Fixed a compiler error, which caused incorrect calculation of the string length in the indicator_label property leading to incorrect display of tooltips for graphical objects.
  8. Fixed the use of multi-line comments in the macro body. An example of a macro where the error occurred:
    #define MACRO1 /*
    #define MACRO2 */
    void OnStart()
    {
    #ifdef MACRO2
        Print( 2 );
    #else
        Print( 1 );
    #endif
    }
  9. Fixed the order of parameters of the MathAtan2 function. The order now matches the similar function in C++.
  10. Added the new TERMINAL_CPU_ARCHITECTURE value to the ENUM_TERMINAL_INFO_STRING enumeration. Also, added the  __CPU_ARCHITECTURE__ macro — obtaining the CPU architecture of the computer the terminal is running on. Example of use:
    void OnStart()
      {
       Print("CPU name:         ",TerminalInfoString(TERMINAL_CPU_NAME));
       Print("CPU cores:        ",TerminalInfoInteger(TERMINAL_CPU_CORES));
       Print("CPU architecture: ",TerminalInfoString(TERMINAL_CPU_ARCHITECTURE));  
       Print("");
       Print("EX5 architecture: ",__CPU_ARCHITECTURE__);                            
      }
    
    CPU name:         12th Gen Intel Core i9-12900K
    CPU cores:        24
    CPU architecture: AVX2 + FMA3
    
    EX5 architecture: AVX

  11. Changed the extern modifier behavior. Now declaration of a variable with the extern modifier is a variable pre-declaration.

    New restrictions:
    1. The variable pre-declaration should not contain initialization. For example, when compiling the code below, we get the error "X - extern variable initialization is not allowed":
      extern int X=0;
      
      void OnStart()
        {
        }

    2. The 'extern' variable should be declared in the program without the 'extern' keyword. For example, when compiling the code below, we get the error "unresolved extern variable X":
      extern int X;
      
      void OnStart()
        {
        }

    3. When using 'extern', it is important to pay attention to the initialization order, because a variable can be accessed before it is initialized. For example, the following code will yield "Y=0 X=5" in the log since initialization of variable Y occurs before initialization of variable X:
      extern int X;
      int        Y=X;
      
      void OnStart(void)
        {
         Print("Y=",Y," X=",X);
        }
        
      int X=_Digits;

MetaEditor

  1. Added the usage of AVX2 instructions in case they are supported by CPU.
  2. Fixed an error occasionally causing freezes during compilation.
  3. Improved display of local variables when debugging.

Tester

  1. Added the usage of AVX2 instructions in case they are supported by CPU.

Updated user interface translations.

Fixed errors reported in crash logs.


MetaTrader 5 Web Terminal build 3950

  1. Added display of the Ask price to the chart settings.



  2. Accelerated initial terminal loading.
  3. Added the ability to change the password.
  4. Added the ability to delete and save the password.
  5. Added a custom period for displaying trading history.
  6. Fixed forced password change.
  7. Fixed calculation of diff — the distance between the open price and TP/SL levels.



  8. Fixed ticks stop error when closing all orders/deals.
  9. Fixed display of Economic calendar events. Sometimes, they were not displayed on the chart despite the option being enabled.
  10. Fixed indicator reset when changing a chart symbol.
  11. Fixed an error in the form of opening a real account when confirming the phone/email.
  12. Added new translations and corrected existing ones.

8 June 2023
MetaTrader 5 build 3800: Book or Cancel orders, AI coding assistant, and enhanced ONNX support

Terminal

  1. Added support for the new order filling policy — Passive / Book or Cancel (BOC).


    New order filling policy — Passive / Book or Cancel


    The BOC policy indicates that an order can only be placed in the Depth of Market (order book). If the order can be filled immediately when placed, this order is canceled. This policy guarantees that the price of the placed order will be worse than the current market price. BOC is used to implement passive trading: it is guaranteed that the order cannot be executed immediately when placed and thus it does not affect current liquidity. This filling policy is only supported for limit and stop limit orders in the Exchange Execution mode.

    The availability of the new filling policy depends on the broker.

  2. The platform switches to using Microsoft Edge WebView2 for displaying the HTML content.

    Compared to the outdated MSHTML, the new component significantly expands content displaying capabilities by providing access to modern technologies. The use of WebView2 improves the appearance of some platform sections, increases performance, and creates a more responsive interface. In particular, the new component will affect the Market, Signals and VPS sections.
    Full support for WebView2 was introduced in Windows 10. We strongly recommend that all users upgrade to the latest operating system version and install all available updates. The platform will continue to use MSHTML under Windows 7 and Wine, but the new features will not be available. The minimum recommended operating system version is Windows 10 21H2 (build 19044, November 2021).

  3. Improved Market security system. Now, in order to run the product, the user must be authorized in the platform with the same MQL5 account via which the product was purchased. The account must be specified under the Tools \ Options \ Community section:


    Specify your MQL5 account in the platform settings


    If no account or an invalid account is specified, the product will not start, and the following message will be printed in the platform journal:
    'ProductName' requires active MQL5 account in Tools->Options->Community
  4. Added Overview command to the history section context menu. The command opens a trading report for the account:


    Command to go to the trading report


  5. Fixed display errors in the two-factor authentication dialog. If the terminal had several accounts with the same number but opened with different brokers, the account connection form could fail to display the one-time password field.
  6. Implemented faster rendering of indicators with the DRAW_COLOR_CANDLES display style.
  7. Fixed trading report creation errors. On-chart profit and equity values could be displayed incorrectly under certain conditions.
  8. Added display of Costs in the trading report. The value shows the total costs incurred when performing deals relative to the symbol's current mid-point price (mid-point spread cost). This is the amount which the trader lost due to the spread. The availability of this value depends on the broker.
  9. Updated UI translations.
  10. Improved stability under Wine, especially on macOS systems. We recommend completely removing old terminals and re-installing them:


  11. Accelerated package installation and updates downloading procedures. Improved analysis of AVX availability on the user's computer when selecting a distribution package.
  12. Enabled support for TLS 1.3 in web protocols. TLS 1.0 is considered deprecated and insecure and has therefore been disabled.
  13. Fixed accounting for agent commissions in trading history reports. The relevant transactions could be ignored when calculating the final profit.
  14. Fixed the inability to change the server in the account connection dialog. The issue arose when there were several accounts in the terminal with the same number from different brokers.
From this build onwards, the installers will work only with 64-bit platform versions. Support for 32-bit versions will be discontinued. Previously installed 32-bit platform versions will work until January 1, 2024.

MQL5

  1. Added new STAT_COMPLEX_CRITERION value in the ENUM_STATISTICS enumeration. Use the property to obtain the calculated complex criterion value, as a result of optimization.
  2. Improved RegressionMetric method used for calculating the regression metric based on the passed matrix or vector. Added vector_true and matrix_true parameters for passing true values which evaluate the predicted data quality.
    double vector::RegressionMetric(
       const vector& vector_true,            // true values
       const ENUM_REGRESSION_METRIC  metric  // metric
       );
     
    double matrix::RegressionMetric(
       const matrix& matrix_true,            // true values
       const ENUM_REGRESSION_METRIC metric   // metric
       );
     
    vector matrix::RegressionMetric(
       const matrix& matrix_true,            // true values
       const ENUM_REGRESSION_METRIC metric,  // metric
       const int                      axis   // axis
       );
  3. Added the LinearRegression method. It returns a vector/matrix with calculated linear regression values for the passed vector/matrix.
    vector vector::LinearRegression();
     
    matrix matrix::LinearRegression(
       ENUM_MATRIX_AXIS axis=AXIS_NONE       // axis along which regression is calculated 
       );
    Example:
    vector vector_a;
    //--- fill the vector with prices
    vector_a.CopyRates(_Symbol,_Period,COPY_RATES_CLOSE,1,100);
    //--- get a linear regression
    vector vector_r=vector_a.LinearRegression();
    The results are visualized in the graph:


    Visualizing the result returned by the LinearRegression method


  4. Added the HasNan method, which returns the number of NaN values in a matrix/vector.
    ulong vector::HasNan();
    ulong matrix::HasNan();
    When comparing the appropriate pair of elements having NaN values, the Compare and CompareByDigits methods consider these elements equal, while in case of a usual comparison of floating-point numbers NaN != NaN.

  5. Modified the OnnxTypeInfo structure which is used for operations with ONNX (Open Neural Network Exchange) models:

    struct OnnxTypeInfo
      {
       ENUM_ONNX_TYPE       type;            // parameter type
       OnnxTensorTypeInfo   tensor;          // tensor description
       OnnxMapTypeInfo      map;             // map description
       OnnxSequenceTypeInfo sequence;        // sequence description
      };

    The data type is specified in the structure using new substructures:

    • OnnxTensorTypeInfo — tensor
    • OnnxMapTypeInfo — map
    • OnnxSequenceTypeInfo — sequence

    struct OnnxTensorTypeInfo
      {
       ENUM_ONNX_DATATYPE   data_type;       // data type in the tensor
       long                 dimensions[];    // number of elements
      };
    
    struct OnnxMapTypeInfo
      {
       ENUM_ONNX_DATA_TYPE  key_type;        // key type
       OnnxTypeInfo         type_info;       // value type
      };
    
    struct OnnxSequenceTypeInfo
      {
       OnnxTypeInfo         type_info;       // data type in the sequence
      };
    Depending on OnnxTypeInfo::type (ONNX_TYPE_TENSOR, ONNX_TYPE_MAP or ONNX_TYPE_SEQUENCE), the relevant substructure is filled.

  6. Improved support for ONNX models.
  7. Added CopyIndicatorBuffer methods which enable the obtaining of indicator buffer data into a vector.
    bool vector<T>::CopyIndicatorBuffer(long indicator_handle,ulong buffer_index,ulong start_pos,ulong count);
    bool vector<T>::CopyIndicatorBuffer(long indicator_handle,ulong buffer_index,datetime start_time,ulong count);
    bool vector<T>::CopyIndicatorBuffer(long indicator_handle,ulong buffer_index,datetime start_time,datetime stop_time);
  8. Fixed operations with arrays having two or more dimensions in the FrameAdd and FrameNext methods.
  9. Fixed CRedBlackTree::Remove Standard Library method.
  10. Implemented fixes in the Fuzzy Logic library.

MetaEditor

  1. Added integration with the advanced automatic coding AI Assistant. Its operation is based on OpenAI models. Enter a comment or part of a function and send a prompt. The neural network will analyze the prompt and will offer coding options to implement the idea.

    Depending on the file type, the string "MQL5 language", "Python language" or "C++ language" is automatically inserted at each prompt beginning. Thus, the neural network will provide the result in the required language.

    AI Assistant is currently free and is already enabled in the editor. There are several options available under Tools \ Options \ AI Assistant:


    AI Assistant settings


    Payment settings:

    • Use your MQL5 account: this option is currently available for free. Later, you will be able to pay for the subscription directly from your MQL5 account balance.
    • Use an OpenAI key, if you have purchased a subscription and have the relevant key.

    Prompt settings:

    • Model — a neural network which will process your requests. text-davinci-003 and gpt-3.5-turbo are currently available. Support for gpt-4 will be added soon.
    • Maximum tokens — the number of text units which the model can return in response to a prompt.
    • Variability — affects how strictly the neural network will follow the prompt. The bigger the value, the greater the result randomness. This option corresponds to the temperature parameter in OpenAI models.

  2. Added ability to view the properties of ONNX models.

    You can view the contents of the *.onnx file directly in the editor. As an example, find the project ONNX.Price.Prediction under Toolbox \ Public Projects and select Join in the context menu. The project will be downloaded to your computer and will appear in the Navigator.


    Open ONNX models directly in MetaEditor


  3. Added ability to visualize machine learning models and neural networks using Netron. This viewer supports popular models, including ONNX, TensorFlow Lite, Caffe, Keras and ncnn, among others.

    To view a model, select its file in the Navigator and click "Open in Netron". If this utility is not installed, its GitHub page will open, from which you can download the relevant installer, according to your operating system. For example, use Netron-Setup-X.X.X.exe for Windows. If the program is installed, the model will immediately open for viewing from the Navigator.


    Visualize machine learning models with Netron


    Supported formats:

    • armnn, caffemodel, circle, ckpt, cmf, dlc, dnn, h5, har, hd5, hdf5, hn, keras, kmodel,
    • lite, mar, meta, mge, mlmodel, mlnet, mlpackage, mnn, model, nb, ngf, nn, nnp,
    • om, onnx, ort, paddle, param, pb, pbtxt, pdiparams, pdmodel, pdopt, pdparams, prototxt, pt, pth, ptl,
    • rknn, t7, tfl, tflite, tmfile, tm, tnnproto, torchscript, uff, xmodel

  4. Updated UI translations.

Tester

  1. Fixed calculation of the "Average losing trade" metric in the testing report. Previously, the calculation could erroneously include entry deals if commissions were charged for such deals.
  2. Improved custom commission options in the strategy tester. To set a symbol, specify its name rather than the entire path.
  3. Updated icons in the strategy tester. New metaphors will make them easier to understand.

Fixed errors reported in crash logs.

Web Terminal

  1. Improved trading history section:

    • Added display of balance operations in the trading history, such as deposits and withdrawals, commissions, and adjustments.
    • Added display of totals in the trading history: balance, profit, commission, deposits, withdrawals and number of orders, among others.
    • Added ability to sort operations and filter the history by depth in the mobile version.


    Updated trading history section


  2. Enhanced symbol contract specifications. The following information has been added: volume limit, tick size and value, initial and hedged margin.
  3. Improved color schemes:

    • Pending orders are displayed in gray on the chart. The position color depends on the direction: red for Sell and blue for Buy. The new colors provide easier navigation especially if a lot of operations are displayed on the chart.
    • When viewing/editing a position, only this position and its levels are highlighted, while all other positions and orders become gray, and their levels are hidden from the price scale. Thus, it will be easier to manage separate operations.
    • The Stop Loss color has been changed from red to orange to avoid confusion with Sell positions.
    • Improved on-chart icons indicating position closing time. A green icon is used for positions closed by Take Profit and a red one is used for those closed by Stop Loss.

  4. Added interface translations into Arabic, Bulgarian, Vietnamese, Greek, Indonesian, Malay, Dutch, Persian, Polish, Thai, Ukrainian and Hindi. The web terminal is now available in 24 languages.
  5. Fixed Turkish UI translations.
  6. Fixed modification and deletion of pending orders in the Web Terminal mobile version.
  7. Fixed on-chart 'closed market' tooltip.
  8. Fixed display of profits in the position close button in the trading dialog. The error occurred during partial closing.
  9. Fixed display of on-chart trading notifications.
  10. Fixed volume modification using arrows in the Depth of Market.
  11. Fixed error which could cause the settings of running indicators to be reset under certain conditions.
  12. Fixed username checks when opening new accounts. Previously, an apostrophe in the name was considered an error.
  13. Fixed processing of requotes. The dialog with the requoted prices might not be displayed under certain conditions.
  14. Fixed display of the Ichimoku Kinko Hyo indicator. The Chikou-Span, Up Kumo and Down Kumo lines will be displayed with the correct offset.
  15. Fixed initial margin checks when opening new orders. The error occurred in the hedging position accounting system.
  16. Fixed scrolling in the contract specification window.

MQL5.community

  1. The MQL5 Cloud Network website has been completely redesigned: https://cloud.mql5.com.

    Learn how to use the processing power of thousands of computers around the world to optimize your trading strategies. With the MQL5 Cloud Network, even the heaviest computations can be completed in a matter of minutes. Visit the website and find out how to participate in the network and how to earn money by providing your computer resources.


    Visit the updated MQL5 Cloud Network website


  2. Improved screenshot section in Market products. Authors can upload images up to 1920*1800 pixels to demonstrate how applications work. The screenshot gallery has also been updated. The carousel shows image thumbnails, and a click on them opens full-sized images.


    Improved screenshot section in the Market


  3. Freelance section improvements. Users will now receive more tips when placing their first orders:

    • Requirements specification examples and a reminder to add one
    • Order creation instructions
    • Template usage tips

    These tips can assist you in creating the order and in receiving the desired result.


    Freelance improvements



24 March 2023
MetaTrader 5 build 3660: Improvements and fixes

Terminal

  1. Fixed occasional incorrect platform log creation.
  2. Updated translations of the user interface.

MQL5

  1. Fixed checking global variables. When declaring identical variables in different namespaces, the compiler gave an erroneous warning that the variable was already declared.

Web Terminal

  1. Added user interface translation into Portuguese. The web terminal is now available in 12 languages.
  2. Fixed the dialog for adding Standard Deviation indicator.
  3. Minor fixes and improvements.
17 March 2023
MetaTrader 5 build 3640: Web Terminal in 11 languages

Web Terminal

  1. Added UI translations into 10 widely spoken languages: Simplified and Traditional Chinese, French, German, Italian, Japanese, Korean, Spanish, Turkish and Russian. This list will be further expanded in future versions. To switch the language, use the relevant menu:


    Web terminal interface available in 11 languages


  2. Optimized connection mechanism to the trade server.

MQL5

  1. MQL5: Added COPY_TICKS_VERTICAL and COPY_RATES_VERTICAL flags for the CopyTicks, CopyTicksRange and CopyRates methods respectively.

    By default, ticks and series are copied to the matrix along the horizontal axis, which means the data is added to the right, at the line end. In trained ONNX model running tasks, such a matrix needs to be transposed in order to feed the input data:

    const long   ExtOutputShape[] = {1,1};    // model's output shape
    const long   ExtInputShape [] = {1,10,4}; // model's input shape
    #resource "Python/model.onnx" as uchar ExtModel[]// model as a resource
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    int OnStart(void)
      {
       matrix rates;
    //--- get 10 bars
       if(!rates.CopyRates("EURUSD",PERIOD_H1,COPY_RATES_OHLC,2,10))
          return(-1);
    //--- input a set of OHLC vectors
       matrix x_norm=rates.Transpose();
       vector m=x_norm.Mean(0);               
       vector s=x_norm.Std(0);
       matrix mm(10,4);
       matrix ms(10,4);

    By specifying the additional flag COPY_RATES_VERTICAL (COPY_TICKS_VERTICAL for ticks) when calling the method, you can eliminate the extra data transposition operation:

    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    int OnStart(void)
      {
       matrix rates;
    //--- get 10 bars
       if(!rates.CopyRates("EURUSD",PERIOD_H1,COPY_RATES_OHLC|COPY_RATES_VERTICAL,2,10))
          return(-1);
    //--- input a set of OHLC vectors
  2. New value in the ENUM_CHART_PROPERTY_INTEGER enumeration — CHART_SHOW_TRADE_HISTORY. The property controls the display of trades from the trading history on the chart. Use the ChartGetInteger and ChartSetInteger functions to obtain and set the property. For further details about the trades display on the chart, please read the platform documentation.

MetaEditor

  • Fixed interface freezing which could occur during file compilation under certain conditions.

Terminal

  • Fixed errors reported in crash logs.
10 March 2023
MetaTrader 5 build 3620: Web Terminal improvements, ONNX support and fast matrix multiplications in MQL5

Terminal

  1. Fixed total profit calculations in trading reports.
  2. Updated fundamental data for trading instruments available through the Market Watch window.
  3. Fixed trading platform launch under Wine 7.0.1 in Linux-systems.
  4. Fixed adding of symbols to the Market Depth via the search bar. A symbol found by description could not be added to the list by clicking on its line.

MQL5

  1.  Added support for operations with ONNX models (Open Neural Network Exchange).

    ONNX is an open-source format for machine learning models. This format is supported by many platforms, including Chainer, Caffee2 and PyTorch. Create an ONNX model using specialized tools, integrate it into your MQL5 application and use it to make trading decisions.

    Descriptions of all supported functions are available in the documentation. An example of a test ONNX model is available in public projects in MetaEditor. Find the ONNX.Price.Prediction project in "Toolbox \ Public projects" and select Join in the context menu. The project will download to your computer and will appear in the Navigator:


    An example of working with an ONNX model in public projects


    Compile the project and run it on EURUSD H1 to see the result.

    In addition to the model and the MQL5 code which runs it, the project also includes the PricePredictionTraining.py Python script. It shows how you can create an ONNX model yourself. To run the script, install Python on your computer and the required modules from the prompt line:

    python.exe -m pip install --upgrade pip
    python -m pip install --upgrade tensorflow
    python -m pip install --upgrade pandas
    python -m pip install --upgrade scikit-learn
    python -m pip install --upgrade matplotlib
    python -m pip install --upgrade tqdm
    python -m pip install --upgrade metatrader5
    python -m pip install --upgrade onnx==1.12
    python -m pip install --upgrade tf2onnx
    Instructions on how to use ONNX are available in the documentation.

  2. Added support for General Matrix Multiplication (GeMM). This algorithm speeds up calculations on some processor types through parallelized tasks and optimized utilization of L1/L2/L3 caches. The calculation speed is comparable with popular packages such as Math Kernel Library (MKL) and OpenBLAS. Detailed comparative tests will be published soon.

    The new algorithm is currently supported in the matrix::GeMM method. If your processor supports AVX and FMA instructions (most processors released after 2013 support these instructions), the algorithm will be enabled automatically.

  3.  Added ability to transfer matrices and vectors to DLL. This enables the import of functions which utilize the relevant types, from external variables.

    Matrices and vectors are passed to a DLL as a pointer to a buffer. For example, to pass a matrix of type float, the corresponding parameter of the function exported from the DLL must take a float-type buffer pointer. For example:

    MQL5
    #import "mmlib.dll"
    bool sgemm(uint flags,matrix<float> &C,const matrix<float> &A,const matrix<float> &B,ulong M,ulong N,ulong K,float alpha,float beta);
    #import
    C++
    extern "C" __declspec(dllexport) bool sgemm(UINT flags,float *C,const float *A,const float *B,UINT64 M,UINT64 N,UINT64 K,float alpha,float beta)
    In addition to buffers, you should pass matrix and vector sizes for correct processing.

  4. Added new CopySeries function for copying synchronized timeseries from MqlRates into separate arrays.

    The CopySeries function allows obtaining only the necessary timeseries into different specified arrays during one call, while all of timeseries data will be synchronized. This means that all values in the resulting arrays at a certain index N will belong to the same bar on the specified Symbol/Timeframe pair. Therefore, there is no need for the programmer to additionally synchronize the received timeseries by the bar opening time.

    Unlike CopyRates, which returns the full set of timeseries as an MqlRates array, the CopySeries function allows obtaining specific required timeseries into separate arrays. This can be done by specifying a combination of flags to select the type of timeseries. The order of the arrays passed to the function must match the order of the fields in the MqlRates structure:

    struct MqlRates
      {
       datetime time;         // period beginning time
       double   open;         // open price
       double   high;         // high price for the period
       double   low;          // low price for the period
       double   close;        // close price
       long     tick_volume;  // tick volume
       int      spread;       // spread
       long     real_volume;  // exchange volume
      }

    Thus, if you need to get the values of the 'time', 'close' and 'real_volume' timeseries for the last 100 bars of the current Symbol/Timeframe, you should use the following call:

    datetime  time[];
    double    close[];
    long      volume[];
    CopySeries(NULL,0,0,100,COPY_RATES_TIME|COPY_RATES_CLOSE|COPY_RATES_VOLUME_REAL,time,close,volume);
    

    The order of the arrays "time, close, volume" must match the order of the fields in the MqlRates structure. The order of values in the rates_mask is ignored. The mask could be as follows:

    COPY_RATES_VOLUME_REAL|COPY_RATES_TIME|COPY_RATES_CLOSE

    Example

    //--- input parameters
    input datetime InpDateFrom=D'2022.01.01 00:00:00';
    input datetime InpDateTo  =D'2023.01.01 00:00:00';
    input uint     InpCount   =20;
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart(void)
      {
    //--- arrays to get timeseries from the Rates structure
       double   open[];
       double   close[];
       float    closef[];
       datetime time1[], time2[];
    //---request close prices to a double array
       ResetLastError();
       int res1=CopySeries(NULL, PERIOD_CURRENT, 0, InpCount,
                           COPY_RATES_TIME|COPY_RATES_CLOSE, time1, close);
       PrintFormat("1. CopySeries  returns %d values. Error code=%d", res1, GetLastError());
       ArrayPrint(close);
       
    
    //--- now also request open prices; use float array for close prices
       ResetLastError();
       int res2=CopySeries(NULL, PERIOD_CURRENT, 0, InpCount,
                           COPY_RATES_TIME|COPY_RATES_CLOSE|COPY_RATES_OPEN, time2, open, closef);
       PrintFormat("2. CopySeries  returns %d values. Error code=%d", res2, GetLastError());
       ArrayPrint(closef);
    //--- compare the received data
       if((res1==res2) && (time1[0]==time2[0]))
         {
          Print("  | Time             |    Open      | Close double | Close float |");
          for(int i=0; i<10; i++)
            {
             PrintFormat("%d | %s |   %.5f    |   %.5f    |   %.5f   |",
                         i, TimeToString(time1[i]), open[i], close[i], closef[i]);
            }
         }
    /*  Result
            1. CopySeries  returns 0 values. Error code=0
            [ 0] 1.06722 1.06733 1.06653 1.06520 1.06573 1.06649 1.06694 1.06675 1.06684 1.06604
            [10] 1.06514 1.06557 1.06456 1.06481 1.06414 1.06394 1.06364 1.06386 1.06239 1.06247
            2. CopySeries  returns 0 values. Error code=0
            [ 0] 1.06722 1.06733 1.06653 1.06520 1.06573 1.06649 1.06694 1.06675 1.06684 1.06604
            [10] 1.06514 1.06557 1.06456 1.06481 1.06414 1.06394 1.06364 1.06386 1.06239 1.06247
              | Time             |    Open      | Close double | Close float |
            0 | 2023.03.01 17:00 |   1.06660    |   1.06722    |   1.06722   |
            1 | 2023.03.01 18:00 |   1.06722    |   1.06733    |   1.06733   |
            2 | 2023.03.01 19:00 |   1.06734    |   1.06653    |   1.06653   |
            3 | 2023.03.01 20:00 |   1.06654    |   1.06520    |   1.06520   |
            4 | 2023.03.01 21:00 |   1.06520    |   1.06573    |   1.06573   |
            5 | 2023.03.01 22:00 |   1.06572    |   1.06649    |   1.06649   |
            6 | 2023.03.01 23:00 |   1.06649    |   1.06694    |   1.06694   |
            7 | 2023.03.02 00:00 |   1.06683    |   1.06675    |   1.06675   |
            8 | 2023.03.02 01:00 |   1.06675    |   1.06684    |   1.06684   |
            9 | 2023.03.02 02:00 |   1.06687    |   1.06604    |   1.06604   |
    */
      }
  5. Fixed OrderSend function operation. The function request could return an incorrect order ticket if the same account was used simultaneously on several platforms.
  6. Fixed import of EX5 libraries. An error occurred if the name of the imported library matched the name of the file into which it was imported.

MetaEditor

  1.  Added sending of push notifications to shared project members. The new option can notifies users of changes in project settings and files. To enable notifications, enter your MetaQuotes ID under the "Settings \ Security" section of your MQL5.community profile.


    Push notifications about project updates


  2. Updated file icons in the Navigator. New, simpler metaphors will make them easier to understand.

Tester

  1. Fixed an error which caused the input string parameter to be truncated if it contained the "|" character.

MetaTrader 5 Web Terminal build 3620

  1. Added ready-made color templates for the web terminal interface. The templates affect the display of chart bars and lines, and the prices in the Market Watch and account financial statements. Our design team has prepared color template presets, based on your suggestions and on traditional color combinations.


    New web terminal color templates


  2. Redesigned symbol specification window. Trading instrument data has been rearranged into logical blocks for ease of viewing.


    Updated trading instrument specification window


  3. Fixed opening of real accounts via the web terminal. The server could return an error after filling out a registration form.
  4. Fixed an error in the trading dialog. If the user closed a position by pressing the X button in the Toolbox window while the position modification dialog was open, the dialog contents were not reset. After the update, the dialog will automatically reset to a new order placing mode in this case.
  5. Fixed display of the Server field in the account management dialog.
  6. Fixed display of the current timeframe on the toolbar.
  7. Fixed display of volumes in terms of underlying asset units, in the trading dialog.
  8. Fixed modification of Stop Loss and Take Profit levels. Modifying one of the values could reset the second one under certain conditions.
  9. Fixed display of investment risk warnings.
6 March 2023
MetaTrader 5 for iPhone/iPad: Improved on-chart trading and analytical functions
  1. Added ability to place stop and stop-limit orders from the chart.

    Only limit orders were available in earlier versions. Select the required type by successively pressing the button in the bottom chart panel.


    Place Stop and Stop Limit orders from the chart


  2. Added ability to access position closing or pending order deletion features from the chart. Select a position or an order level on the chart, and the relevant command will appear in the lower trading panel:


    Manage positions and orders from the chart


  3. Improved functionality which shifts the right border of the price chart. To change the shift, simply scroll the chart to the last price until a vertical separator appears. Next, drag the triangle at the bottom chart scale:


    Change the chart shift by dragging the triangle at the lower scale


  4. Added ability to copy analytical objects on the chart. This enables faster chart markup. Open the object menu with a long press and select "Copy":

    Create copies of analytic objects


  5. Added ability to manage the display of indicators on different timeframes. If the indicator is not suitable for certain chart periods, it can be hidden to free up space on the screen for other analytical tools.


    Manage the display of indicators on different timeframes


  6. Added display of symbol commissions in the instrument specification window.


    Find out the commission amount in the instrument specification


  7. Added password recovery link. An account password can only be restored via the relevant broker. The link shows the broker's contact details.


    Help with password recovery


  8. Added ability to share a link to an MQL5.community channel.


    Share a link to your channel through the app


  9. Improved user experience when connecting to an account with trading restrictions.

    Trading can be limited for various reasons: investor mode connection; a trading agreement has not been accepted; broker verification has not been completed and others. Previously, the reason for the unavailability of trading functions was not explained.

    Now, if trading is restricted, the order placing button in the Trade section will be grayed out. When pressed, it will show the relevant information and recommendations.


    Useful information when trading is restricted


  10. Improved workflow with SSL certificates which are used for advanced authentication.

    Now, when the user connects to an account with advanced authentication, the app will show a brief description of the required actions.


    Improved work with SSL certificates


    A certificate can be imported from a PFX file. Save the necessary file in the Files app and then use the import function in the start dialog.

    It has also become possible to import certificates to files, which enables the use of certificates on other devices. To do this, go to Settings \ Certificates and select "Export" in the certificate menu.

  11. Construction of price charts has been transferred to Metal, which is the latest-generation graphics API used in Apple devices. This significantly increases the chart, indicator and object rendering performance.
  12. Fixed substitution of Stop Loss and Take Profit levels in the Depth of Market. For FIFO accounts, stop levels will be automatically set in accordance with the stop levels of existing open positions for the same instrument. This process is required to comply with the FIFO rule.
  13. Fixed requoting. When a requote is returned, the user is given a short time to accept or to decline the new prices. If no action is taken within the required time frame, the request is automatically rejected and the requote window is automatically closed.
  14. Fixed display of time in the Chart section when using the dark interface theme.
16 December 2022
MetaTrader 5 build 3550: Improvements and fixes

Terminal

  1. Terminal: Updated translations of the user interface.
  2. Fixes based on crash logs.

Web Terminal

9 December 2022
MetaTrader 5 platform build 3540: 2FA/TOTP authentication and improved Market Watch in Web Terminal

Web Terminal

  1. Added support for 2FA/TOTP authentication using Google Authenticator and similar apps.

    The 2FA/TOTP authentication protects a trading account from unauthorized access even if its login and password are leaked. Authentication using Time-based One-time Password Algorithm (TOTP) can be implemented using various mobile apps. The most popular of them are Google Authenticator, Microsoft Authenticator, LastPass Authenticator and Authy. Now you can connect to your account in the MetaTrader 5 client terminal using one-time passwords generated by such Authenticator apps.

    To enable the two-factor authentication option, connect to your account via MetaTrader 5 Web Terminal. Then click on your account in the menu and select "Enable 2FA/TOTP" in the newly opened dialog. Run the Authenticator app on your mobile device, click "+" to add your trading account and scan the QR code from the terminal. Enter the generated code in the "One-time password" field and click "Enable 2FA". A secret will be registered for your account on the broker's trading server.


    Added support for 2FA/TOTP authentication using Google Authenticator and similar apps


    The saved secret will be used in the Authenticator app to generate an OTP code every time you connect to your account. Each password is valid for 30 seconds. After that a new one is generated.


    An additional OTP from the Authenticator app will be required for connecting to the account


    A backup code is also displayed in the QR code dialog for linking to the generator. Save it in a secure place. If you lose access to your linked device, the code will allow you to add your account to the Authenticator app again.

    If you decide to remove the stored secret from the Authenticator app, you should first disable 2FA/TOTP authentication using the appropriate account menu command. If the new 2FA/TOTP authentication method is not available on your account, please contact your broker.

  2. Expanded the amount of data displayed in the Market Watch. Now, in addition to the current Bid/Ask prices and the price change percentage, you can see:

    • Maximum and minimum Bid/Ask price for the current trading session
    • Open prices of the current trading session and close prices of the previous trading session

    Use the context menu to customize the displayed information:


    Additional Market Watch data


  3. Added risk notification display when a corresponding setting is enabled on the broker's side. Some regulators require that traders read and accept the notification before trading.
  4. Fixed display of the top toolbar on iPhone models featuring a notch at the top of the screen. Previously, it occasionally could cover the panel buttons.
  5. Fixed display of the account final financial parameters (profit, equity, etc.) in the Google Chrome browser. Sometimes, they were not updated.

Terminal

  1. Optimized and greatly accelerated the demo account opening dialog.
  2. Updated translations of the user interface.
  3. Fixes based on crash logs.

MQL5

  1. Added new methods to the COpenCL class of the Standard Library:

    • BufferFromMatrix — filling the device buffer with data from the matrix
    • BufferToMatrix — reading data from the device buffer into the matrix
    • ContextCreate — creating the device context (the first part of the Initialize method)
    • ProgramCreate — creating a program based on the OpenCL source code (the second part of the Initialize method)
    • ContextClean — releasing all data belonging to the device context (similar to the Shutdown method but without removing the context)
    • GetDeviceInfoInteger — receiving an integer device property
    • GetKernelInfoInteger — receiving an integer kernel property
    • GetDeviceInfo — receiving any single integer device property not present in the ENUM_OPENCL_PROPERTY_INTEGER enumeration

    GetDeviceInfo usage example:
    long preferred_workgroup_size_multiple=OpenCL.GetDeviceInfo(0x1067);
  2. Added the TERMINAL_CPU_NAME and TERMINAL_OS_VERSION values to the ENUM_TERMINAL_INFO_STRING enumeration. They allow receiving the user's CPU and OS names.
    void OnStart()
      {
       string cpu,os;
    //---
       cpu=TerminalInfoString(TERMINAL_CPU_NAME);
       os=TerminalInfoString(TERMINAL_OS_VERSION);
       PrintFormat("CPU: %s, OS: %s",cpu,os);
      }
    
    Result:
    CPU: Intel Xeon  E5-2630 v4 @ 2.20GHz, OS: Windows 10 build 19045
  3. Fixed operation of the "table_or_sql" parameter in the DatabasePrint and DatabaseExport functions. Now it is able to pass a table name in addition to a SQL query.

MetaEditor

  1. Fixed the check for the maximum number of displayable columns in the database. Up to 64 columns can now be displayed.
  2. Fixed operation of breakpoints in short constructions like IF[ if(cond) break; ].
25 November 2022
MetaTrader 5 build 3520: 2FA/TOTP authentication using Google Authenticator

Terminal

  1. Added 2FA/TOTP authentication using Google Authenticator and similar apps.

    The 2FA/TOTP authentication protects a trading account from unauthorized access even if its login and password are leaked. Authentication using Time-based One-time Password Algorithm (TOTP) can be implemented using various mobile apps. The most popular of them are Google Authenticator, Microsoft Authenticator, LastPass Authenticator and Authy. Now you can connect to your account in the MetaTrader 5 client terminal using one-time passwords generated by such Authenticator apps.

    To enable the two-factor authentication option, connect to your account and execute the "Enable 2FA/TOTP" command in the account context menu. Run the Authenticator app on your mobile device, click "+" to add your trading account and scan the QR code from the terminal. Enter the generated code in the "One-time password" field and click "Enable 2FA". A secret will be registered for your account on the broker's trading server.


    Added support for 2FA/TOTP authentication using Google Authenticator and similar apps.

    The saved secret will be used in the Authenticator app to generate an OTP code every time you connect to your account. Each password is valid for 30 seconds. After that a new one is generated.



    An additional OTP from the Authenticator app will be required for connecting to the account

    If you decide to remove the stored secret from the Authenticator app, you should first disable 2FA/TOTP authentication using the appropriate account context menu command. If the new 2FA/TOTP authentication method is not available on your account, please contact your broker.

MQL5

  1. Fixed operation of the CopyTicks function for custom trading instruments. When working with custom symbols, previous session's initial ticks could be returned instead of requested data, under certain conditions.

  2. Added new enumeration values to get the last OpenCL error code and text description.
    1. Value CL_LAST_ERROR (code 4094) has been added to the ENUM_OPENCL_PROPERTY_INTEGER enumeration

      When obtaining the last OpenCL error via CLGetInfoInteger, the handle parameter is ignored. Error descriptions: https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_SUCCESS.
      For an unknown error code, the string "unknown OpenCL error N" is returned, where N is the error code.

      Example:
      //--- the first handle parameter is ignored when obtaining the last error code
      int code = (int)CLGetInfoInteger(0,CL_LAST_ERROR);

    2. Value CL_ERROR_DESCRIPTION (4093) has been added to the ENUM_OPENCL_PROPERTY_STRING enumeration.
      A text error description can be obtained using CLGetInfoString. Error descriptions: https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_SUCCESS.

      When using CL_ERROR_DESCRIPTION, an error code should be passed as the handle parameter in CLGetInfoString. If CL_LAST_ERROR is passed instead of the error code, the function will return the last error description.

      Example:
      //--- get the code of the last OpenCL error
      int    code = (int)CLGetInfoInteger(0,CL_LAST_ERROR);
      string desc; // to get the text description of the error
      
      //--- use the error code to get the text description of the error
      if(!CLGetInfoString(code,CL_ERROR_DESCRIPTION,desc))
         desc = "cannot get OpenCL error description, " + (string)GetLastError();
      Print(desc);
      
      
      //--- to get the description of the last OpenCL error without receiving the code, pass CL_LAST_ERROR  
      if(!CLGetInfoString(CL_LAST_ERROR,CL_ERROR_DESCRIPTION, desc))
         desc = "cannot get OpenCL error description, " + (string)GetLastError();
      Print(desc);
      The internal enumeration name is passed as the error description. Its explanation can be found at https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_SUCCESS. For example, the CL_INVALID_KERNEL_ARGS value means "Returned when enqueuing a kernel when some kernel arguments have not been set or are invalid."

  3. Fixed operation of the matrix::MatMul method. When working with large matrices, the terminal could crash on certain sizes.

Fixed errors reported in crash logs.
previous12345678910111213141516