What's new in MetaTrader 5

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

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 Copilot automatic coding 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 assistant Copilot. 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.


    Copilot coding assistant


    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.

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


    Copilot 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.
18 November 2022
MetaTrader 5 build 3510: Web Terminal improvements

MetaTrader 5 WebTerminal

  1. In the mobile version we have implemented trading history sorting and filtering by depth. Use the top-panel commands to customize the history display:


    Customizable trading history view in the mobile version


    Operations can be sorted by the main parameters, such as date, ticket, symbol and volume, among others.

  2. Improved access to trading account details.

    • In the desktop version the current account data is clickable. Click on the account to view its details.
    • In the mobile version the current account is displayed under the Settings section. Click on the account to view its details.


    Improved access to trading account data

  3. Fixed display of the account type in the account management window.
  4. Fixed equity and free margin display after refreshing the web terminal page in mobile browsers.
  5. Fixed bottom bar display in Firefox mobile browser

Terminal

  1. Fixed equity and balance graph calculations in the trading report.

MQL5

  1. New behavior of typename(expr). The updated function returns the full type with modifiers and dimensions (for arrays):
    class A
      {
      };
    
    void OnStart(void)
      {
       const A *const arr[][2][3]={};
       Print(typename(arr));
      }
    
    Result:
    "class A const * const [][2][3]"
Fixed errors reported in crash logs.



11 November 2022
MetaTrader 5 build 3500: Improvements and fixes

Terminal

  1. A new command has been added to the context menu of the Trade and History sections, to enable access to the new trading report.

    Added command to access the new trading report


    The trading report provides the following performance data:
    • Graphs and tables visualizing monthly growth metrics
    • Equity chart
    • Radar chart which enables quick account state evaluation
    • Trading statistics by instrument
    • A variety of additional metrics for trading analysis

  2. Fixed initial deposit calculations in the trading report.
  3. Fixed setting of Stop Loss and Take Profit levels when using using the quick trading panel in the chart and Market Watch. The levels could be inherited from previously opened positions even when the inheritance was not required (the relevant functionality is implemented for FIFO-based accounts).
  4. Updated user interface translations.

MQL5

  1. Fixed a compiler bug which enabled access to a structure field using a constant string with the field name value.
  2. MQL5: Fixed checking of key states using the TerminalInfoInteger(TERMINAL_KEYSTATE_*) function.

Fixed errors reported in crash logs.

MetaTrader 5 WebTerminal build 3500

  1. Fixed position closing upon requotes.
  2. Fixed reconnection to the server after maximizing a browser window which has been inactive for a long time.
  3. Fixed display of credit funds.
  4. ther improvements and fixes.

4 November 2022
MetaTrader 5 build 3490: Mobile Web Terminal version and new matrix methods in MQL5
Mobile version of the web platform

The new Web Terminal provides full-featured support for mobile devices. The interface will automatically adapt to the screen size, enabling efficient operations from iOS and Android phones and tablets:

Added support for mobile devices in the new web terminal

Also, the Web Terminal features a lot of fixes and improvements.

The new MetaTrader 5 Web Terminal supports the full set of trading functions. It enables users to:

  • Work with demo and live accounts
  • Receive any financial symbol quotes
  • Trade in any markets
  • Analyze symbol quotes using more than 30 indicators and 20 graphical objects
  • Use Economic Calendar data for fundamental analysis


Terminal

  1. Extended task manager features. The new version enables more accurate monitoring of consumed resources.

    • Added stack size display for threads.
    • Added display of the number of context switches.
    • Added recognition of system and third-party DLL threads.
    • Added display of kernel mode operating time. An increase in this metric compared to the time spent in user mode can indicate system-level issues: drivers problems, hardware errors or slow hardware. For further details, please read the Microsoft Documentation.
    • Added display of user mode operating time.

    Terminal: Extended task manager features. The new version enables more accurate monitoring of consumed resources


  2. New OpenCL tab in terminal settings for managing available devices. The new OpenCL manager enables explicit specification of devices to be used for calculations.

    OpenCL manager to control available devices

  3. Added indication of Stop Loss and Take Profit levels in the Depth of Market for accounts operating in FIFO mode (the mode can be enabled on the broker's side).

    According to the FIFO rule, positions for each instrument can only be closed in the same order in which they were opened. To ensure FIFO-compliant position closing by stop levels, the following logic has been implemented on the client terminal side:

    If multiple positions exist for the same instrument, the placing of stop levels for any of the positions causes the same levels to be placed for all other positions as well. Accordingly, if a level triggers, all positions will be closed in a FIFO-compliant order.

    Now, when the user opens the Depth of Market for an instrument which already has open positions for, the levels of existing positions (if any) are automatically specified in the Stop Loss and Take Profit fields.

  4. Fixed deletion of Stop Loss and Take Profit levels using X buttons in the Toolbox\Trade window. The error occurred when the quick trading function was disabled. A click on the button will open a trading dialog with an empty value of the relevant level.

  5. Fixed graph captions and final commission calculations in the trading report. The section could show incorrect Profit in report statistics and incorrect values in Equity and Balance graph tooltips.

MQL5

  1. Added vector and matrix methods CopyTicks and CopyTicksRange. They enable easy copying of tick data arrays into vectors and matrices.
    bool matrix::CopyTicks(string symbol,uint flags,ulong from_msc,uint count);
    bool vector::CopyTicks(string symbol,uint flags,ulong from_msc,uint count);
    
    bool matrix::CopyTicksRange(string symbol,uint flags,ulong from_msc,ulong to_msc);
    bool matrix::CopyTicksRange(string symbol,uint flags,ulong from_msc,ulong to_msc);
    The copied data type is specified in the 'flags' parameter using the ENUM_COPY_TICKS enumeration. The following values are available:
    COPY_TICKS_INFO    = 1,       // ticks resulting from Bid and/or Ask changes
    COPY_TICKS_TRADE   = 2,       // ticks resulting from Last and Volume changes
    COPY_TICKS_ALL     = 3,       // all ticks having changes
    COPY_TICKS_TIME_MS = 1<<8,    // time in milliseconds
    COPY_TICKS_BID     = 1<<9,    // Bid price
    COPY_TICKS_ASK     = 1<<10,   // Ask price
    COPY_TICKS_LAST    = 1<<11,   // Last price
    COPY_TICKS_VOLUME  = 1<<12,   // volume
    COPY_TICKS_FLAGS   = 1<<13,   // tick flags
    If multiple data types are selected (only available for matrices), the order of the rows in the matrix will correspond to the order of values in the enumeration.

  2. Expanded features of matrix::Assign and vector::Assign methods.

    Now the matrix can be assigned a one-dimensional array or vector:
    bool matrix::Assign(const vector &vec);
    The result will be a one-row matrix.

    Also, a matrix can now be assigned to a vector (matrix smoothing will be performed):
    bool vector::Assign(const matrix &mat);
  3. Added Swap methods for vectors and matrices.
    bool vector::Swap(vector &vec);
    bool vector::Swap(matrix &vec);
    bool vector::Swap(double &arr[]);
    bool matrix::Swap(vector &vec);
    bool matrix::Swap(matrix &vec);
    bool matrix::Swap(double &arr[]);
    Each array, vector or matrix refers to a memory buffer which contains the elements of that object. The Swap method actually swaps pointers to these buffers without writing the elements to memory. Therefore, a matrix remains a matrix, and a vector remains a vector. Swapping a matrix and a vector will result in a one-row matrix with vector elements and a vector with matrix elements in a flat representation (see the Flat method).
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
     {
    //---
      matrix a= {{1, 2, 3}, {4, 5, 6}};
      Print("a before Swap: \n", a);
      matrix b= {{5, 10, 15, 20}, {25, 30, 35, 40}, {45, 50, 55, 60}};
      Print("b before Swap: \n", b);  
    //--- swap matrix pointers
      a.Swap(b);
      Print("a after Swap: \n", a);
      Print("b after Swap: \n", b);
      /*
      a before Swap:
      [[1,2,3]
      [4,5,6]]
      b before Swap:
      [[5,10,15,20]
      [25,30,35,40]
      [45,50,55,60]]
      
      a after Swap:
      [[5,10,15,20]
      [25,30,35,40]
      [45,50,55,60]]
      b after Swap:
      [[1,2,3]
      [4,5,6]]
      */
      vector v=vector::Full(10, 7);
      Print("v before Swap: \n", v);
      Print("b before Swap: \n", b);
      v.Swap(b);
      Print("v after Swap: \n", v);
      Print("b after Swap: \n", b);
      /*
      v before Swap:
      [7,7,7,7,7,7,7,7,7,7]
      b before Swap:
      [[1,2,3]
      [4,5,6]]
      
      v after Swap:
      [1,2,3,4,5,6]
      b after Swap:
      [[7,7,7,7,7,7,7,7,7,7]]
      */
     }
    The Swap() method also enables operations with dynamic arrays (fixed-sized arrays cannot be passed as parameters). The array can be of any dimension but of an agreed size, which means that the total size of a matrix or vector must be a multiple of the array's zero dimension. The array's zero dimension is the number of elements contained at the first index. For example, for a dynamic three-dimensional array 'double array[][2][3]', the zero dimension is the product of the second and third dimension sizes: 2x3=6. So, such an array can only be used in the Swap method with matrices and vectors whose total size is a multiple of 6: 6, 12, 18, 24, etc.

    Consider the following example:
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
     {
    //--- fill the 1x10 matrix with the value 7.0
      matrix m= matrix::Full(1, 10, 7.0);
      Print("matrix before Swap:\n", m);
    //--- try to swap the matrix and the array
      double array_small[2][5]= {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}};
      Print("array_small before Swap:");
      ArrayPrint(array_small);
      if(m.Swap(array_small))
       {
        Print("array_small after Swap:");
        ArrayPrint(array_small);
        Print("matrix after Swap: \n", m);
       }
      else // the matrix size is not a multiple of the first array dimension
       {
        Print("m.Swap(array_small) failed. Error ", GetLastError());
       }
      /*
      matrix before Swap:
      [[7,7,7,7,7,7,7,7,7,7]]
      array_small before Swap:
               [,0]     [,1]     [,2]     [,3]     [,4]
      [0,]  1.00000  2.00000  3.00000  4.00000  5.00000
      [1,]  6.00000  7.00000  8.00000  9.00000 10.00000
      m.Swap(array_small) failed. Error 4006
      */
    //--- use a larger matrix and retry the swap operation
      double array_static[3][10]= {{1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
         {2, 4, 6, 8, 10, 12, 14, 16, 18, 20},
         {3, 6, 9, 12, 15, 18, 21, 24, 27, 30}
       };
      Print("array_static before Swap:");
      ArrayPrint(array_static);
      if(m.Swap(array_static))
       {
        Print("array_static after Swap:");
        ArrayPrint(array_static);
        Print("matrix after Swap: \n", m);
       }
      else // a static array cannot be used to swap with a matrix
       {
        Print("m.Swap(array_static) failed. Error ", GetLastError());
       }
      /*
      array_static before Swap:
             [,0]     [,1]     [,2]     [,3]     [,4]     [,5]     [,6]     [,7]     [,8]     [,9]
      [0,]  1.00000  2.00000  3.00000  4.00000  5.00000  6.00000  7.00000  8.00000  9.00000 10.00000
      [1,]  2.00000  4.00000  6.00000  8.00000 10.00000 12.00000 14.00000 16.00000 18.00000 20.00000
      [2,]  3.00000  6.00000  9.00000 12.00000 15.00000 18.00000 21.00000 24.00000 27.00000 30.00000
      m.Swap(array_static) failed. Error 4006
      */
    //--- another attempt to swap an array and a matrix
      double array_dynamic[][10];    // dynamic array
      ArrayResize(array_dynamic, 3); // set the first dimension size
      ArrayCopy(array_dynamic, array_static);
    //--- now use a dynamic array for swap
      if(m.Swap(array_dynamic))
       {
        Print("array_dynamic after Swap:");
        ArrayPrint(array_dynamic);
        Print("matrix after Swap: \n", m);
       }
      else //  no error
       {
        Print("m.Swap(array_dynamic) failed. Error ", GetLastError());
       }
      /*
      array_dynamic after Swap:
            [,0]    [,1]    [,2]    [,3]    [,4]    [,5]    [,6]    [,7]    [,8]    [,9]
      [0,] 7.00000 7.00000 7.00000 7.00000 7.00000 7.00000 7.00000 7.00000 7.00000 7.00000
      matrix after Swap:
      [[1,2,3,4,5,6,7,8,9,10,2,4,6,8,10,12,14,16,18,20,3,6,9,12,15,18,21,24,27,30]]
      */
     }
  4. Added LossGradient method for vectors and matrices. This method calculates a vector or matrix of partial derivatives of the loss function on predicted values. In linear algebra, such a vector is referred to as a gradient and is used in machine learning.
    vector vector::LossGradient(const vector &expected,ENUM_LOSS_FUNCTION loss) const;
    matrix matrix::LossGradient(const matrix &expected,ENUM_LOSS_FUNCTION loss) const;
  5. Enabled use of FOREIGN KEYS in SQLite to enforce relationships between tables in SQL queries.   Example:
    CREATE TABLE artist(
      artistid    INTEGER PRIMARY KEY, 
      artistname  TEXT
    );
    
    CREATE TABLE track(
      trackid     INTEGER, 
      trackname   TEXT, 
      trackartist INTEGER,
      FOREIGN KEY(trackartist) REFERENCES artist(artistid)
    );

  6. Fixed selection of the appropriate class method depending on the method and object constness.

MetaEditor

  1. Increased allowable length of comments in commits to MQL5 Storage. Detailed comments when committing changes to the repository are considered good practice when working in large projects, but previously the comment length has been limited to 128 characters. The allowed length is now up to 260 characters.

MetaTester

  1. Increased sensitivity of the testing speed switch in visual mode.

Fixed errors reported in crash logs.


17 September 2022
MetaTrader 5 build 3440: New trading account report

Terminal

  1. Added new account trading performance report. It is similar to the already familiar Signals reports in terms of statistics availability and data presentation. The following performance data will be available in the platform:
    • Graphs and tables visualizing monthly growth metrics
    • Equity chart
    • Radar chart which enables quick account state evaluation
    • Trading statistics by instrument
    • A variety of additional metrics for trading analysis

    The report can be viewed directly in the platform, without the need to export it to a file. To open it, select Reports in the View menu.



  2. Fixed options board filling for Call and Put contracts with unmatching quantity or symbol type.
  3. Fixed position selection in the Trade dialog during Close by operations. The error occurred for opposite order lists sorted by any column other than the ticket.
  4. Accelerated platform logging.
  5. Fixed display of comments on custom symbol charts.

MQL5

  1. Fixed CArrayList::LastIndexOf function operation. Previously, it always returned -1 instead of the index of the last found element.
  2. Added new matrix and vector method - Assign. It replaces matrix/vector elements with the passed matrix/vector or array data.
    bool vector<TDst>::Assign(const vector<TSrc> &assign);
    bool matrix<TDst>::Assign(const matrix<TSrc> &assign);
    
    Example:
      //--- copying matrices
      matrix b={};
      matrix a=b;
      a.Assign(b);
      
      //--- copying an array to a matrix
      double arr[5][5]={{1,2},{3,4},{5,6}};
      Print("array arr");
      ArrayPrint(arr);
      b.Assign(arr);
      Print("matrix b \n",b);
    /*
    array arr
            [,0]    [,1]    [,2]    [,3]    [,4]
    [0,] 1.00000 2.00000 0.00000 0.00000 0.00000
    [1,] 3.00000 4.00000 0.00000 0.00000 0.00000
    [2,] 5.00000 6.00000 0.00000 0.00000 0.00000
    [3,] 0.00000 0.00000 0.00000 0.00000 0.00000
    [4,] 0.00000 0.00000 0.00000 0.00000 0.00000
    matrix b 
    [[1,2,0,0,0]
     [3,4,0,0,0]
     [5,6,0,0,0]
     [0,0,0,0,0]
     [0,0,0,0,0]]
    
    */
  3. Added new matrix and vector method - CopyRates. It copies price data arrays into vectors and matrices.
    bool matrix::CopyRates(string symbol,ENUM_TIMEFRAMES period,ulong rates_mask,ulong from,ulong count);
    bool vector::CopyRates(string symbol,ENUM_TIMEFRAMES period,ulong rates_mask,ulong from,ulong count);
    The copied data type is specified in the rates_mask parameter using the ENUM_COPY_RATES enumeration. The following values are available:
    COPY_RATES_OPEN
    COPY_RATES_HIGH
    COPY_RATES_LOW
    COPY_RATES_CLOSE
    COPY_RATES_TIME
    COPY_RATES_VOLUME_TICK
    COPY_RATES_VOLUME_REAL
    COPY_RATES_SPREAD
    COPY_RATES_OHLC
    COPY_RATES_OHLCT
    The last two values enable the simultaneous selection of multiple bar parameters: Open, High, Low, Close and time.

    If multiple data types are selected (only available for matrices), the order of the rows in the matrix will correspond to the order of values in the enumeration.

  4. Fixed display of Text Label objects. When using OBJPROP_XOFFSET and OBJPROP_YOFFSET properties, a wrong image fragment could be displayed on the chart.

  5. Fixed error when changing a constant parameter which has been passed to a function as an object pointer reference.

    The const specifier declares a variable as a constant to prevent it from being changed during program execution. It only allows one-time variable initialization during declaration. An example of constant variables in the OnCalculate function:

    int OnCalculate (const int rates_total,      // price[] array size
                     const int prev_calculated,  // bars processed on previous call
                     const int begin,            // meaningful data starts at
                     const double& price[]       // array for calculation
       );
    

    The below example contains a compiler error which allowed an implicit pointer casting for reference parameters:

    class A {};
    const A *a = new A;
    
    void foo( const A*& b )
      {
       b = a;
      }
    
    void OnStart()
      {
            A *b; 
            foo(b);  // not allowed
            Print( a,":",b );
      }
    The compiler will detect such illegal operations and will return the relevant error.

MetaEditor

  1. Fixed display of complex number references in the debugger.
  2. Improved MQL5 Cloud Protector. Previously, file protection could fail under certain conditions.
  3. Fixed errors reported in crash logs.


New MetaTrader 5 Web Terminal

We have released a revised MetaTrader 5 Web Terminal which features an updated interface and a redesigned core. The new interface is similar to the terminal version for iPad:



It also features a plethora of new functions:

  • Ability to request real accounts with the detailed registration form and document submission options
  • Support for price data subscriptions and the ability to receive delayed quotes
  • More analytical objects with convenient management options
  • Market entries and exits displayed on charts
  • Economic Calendar events displayed on charts
  • Convenient configuration of instruments in the Market Watch, along with the daily price change data
  • Simplified interface to assist beginners in getting started with the terminal: removed chart context menu and top menu; all chart control commands, objects and indicators are available on the left-hand side and top panels, while other commands can be accessed through the hamburger menu
  • Interface dark mode

Try the new web terminal at www.mql5.com right now. It will soon become available for your brokers.

4 August 2022
MetaTrader 5 build 3390: Float in OpenCL and in mathematical functions, Activation and Loss methods for machine learning

Terminal

  1. Added automatic opening of a tutorial during the first connection to a trading account. This will assist beginners in learning trading basics and in exploring platform features. The tutorial is divided into several sections, each of which provides brief information on a specific topic. The topic completion progress is shown with a blue line.

    Added automatic opening of a tutorial during the first connection to a trading account.

  2. Fixed 'Close profitable'/'Close losing' bulk operations. Previously, the platform used opposite positions if they existed. For example, if you had two losing Buy positions for EURUSD and one profitable Sell position for EURUSD, all three positions would be closed during the 'Close losing' bulk operation. Buy and Sell would be closed by a 'Close by' operation, while the remaining Buy would be closed by a normal operation. Now the commands operate properly: they only close the selected positions, either profitable or losing.
  3. Fixed display of negative historical prices. Such prices will appear correctly for all timeframes.
  4. Optimized and significantly reduced system resource consumption by the terminal.
  5. Updated fundamental database for trading instruments. The number of data aggregators available for exchange instruments has been expanded to 15. Users will be able to access information on even more tickers via the most popular economic aggregators.

    Updated fundamental database for trading instruments.


    About 7,000 securities and more than 2,000 ETFs are listed on the global exchange market. Furthermore, exchanges provide futures and other derivatives. The MetaTrader 5 platform offers access to a huge database of exchange instruments. To access the relevant fundamental data, users can switch to the selected aggregator's website in one click directly from the Market Watch. For convenience, the platform includes a selection of information sources for each financial instrument.
  6. Fixed Stop Loss and Take Profit indication in the new order placing window. For FIFO accounts, stop levels will be automatically set in accordance with the stop levels of existing open positions for the same instrument. This procedure is required to comply with the FIFO rule.

MQL5

  1. Mathematical functions can now be applied to matrices and vectors.

    We continue expanding algorithmic trading and machine learning capabilities in the MetaTrader 5 platform. Previously, we have added new data types: matrices and vectors, which eliminate the need to use arrays for data processing. More than 70 methods have been added to MQL5 for operations with these data types. The new methods enable linear algebra and statistics calculations in a single operation. Multiplication, transformation and systems of equations can be implemented easily, without extra coding. The latest update includes mathematical functions.

    Mathematical functions were originally designed to perform relevant operations on scalar values. From this build and onward, most of the functions can be applied to matrices and vectors. These include MathAbs, MathArccos, MathArcsin, MathArctan, MathCeil, MathCos, MathExp, MathFloor, MathLog, MathLog10, MathMod, MathPow, MathRound, MathSin, MathSqrt, MathTan, MathExpm1, MathLog1p, MathArccosh, MathArcsinh, MathArctanh, MathCosh, MathSinh, and MathTanh. Such operations imply element-wise handling of matrices and vectors. Example:
    //---
      matrix a= {{1, 4}, {9, 16}};
      Print("matrix a=\n",a);
    
      a=MathSqrt(a);
      Print("MatrSqrt(a)=\n",a);
      /*
       matrix a=
       [[1,4]
        [9,16]]
       MatrSqrt(a)=
       [[1,2]
        [3,4]]
      */
    For MathMod and MathPow, the second element can be either a scalar or a matrix/vector of the appropriate size.

    The following example shows how to calculate the standard deviation by applying math functions to a vector.
    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
     {
    //--- Use the initializing function to populate the vector
      vector r(10, ArrayRandom); // Array of random numbers from 0 to 1
    //--- Calculate the average value
      double avr=r.Mean();       // Array mean value
      vector d=r-avr;            // Calculate an array of deviations from the mean
      Print("avr(r)=", avr);
      Print("r=", r);
      Print("d=", d);
      vector s2=MathPow(d, 2);   // Array of squared deviations
      double sum=s2.Sum();       // Sum of squared deviations
    //--- Calculate standard deviation in two ways
      double std=MathSqrt(sum/r.Size());
      Print(" std(r)=", std);
      Print("r.Std()=", r.Std());    
     }
    /*
      avr(r)=0.5300302133243813
      r=[0.8346201971495713,0.8031556138798182,0.6696676534318063,0.05386516922513505,0.5491195410016175,0.8224433118686484,...
      d=[0.30458998382519,0.2731254005554369,0.1396374401074251,-0.4761650440992462,0.01908932767723626,0.2924130985442671, ...
       std(r)=0.2838269732183663
      r.Std()=0.2838269732183663
    */ 
    //+------------------------------------------------------------------+
    //| Fills the vector with random values                              |
    //+------------------------------------------------------------------+
    void ArrayRandom(vector& v)
     {
      for(ulong i=0; i<v.Size(); i++)
        v[i]=double(MathRand())/32767.;
     }
    

  2. Added support in template functions for notations matrix<double>, matrix<float>, vector<double>, vector<float> instead of the corresponding matrix, matrixf, vector and vectorf types.
  3. Improved mathematical functions for operations with the float type. The newly implemented possibility to apply mathematical functions to 'float' matrix and vectors has enabled an improvement in mathematical functions applied to 'float' scalars. Previously, these function parameters were unconditionally cast to the 'double' type, then the corresponding implementation of the mathematical function was called, and the result was cast back to the 'float' type. Now the operations are implemented without extra type casting.

    The following example shows the difference in the mathematical sine calculations:

    //+------------------------------------------------------------------+
    //| Script program start function                                    |
    //+------------------------------------------------------------------+
    void OnStart()
     {
    //---  Array of random numbers from 0 to 1
      vector d(10, ArrayRandom);
      for(ulong i=0; i<d.Size(); i++)
       {
        double delta=MathSin(d[i])-MathSin((float)d[i]);
        Print(i,". delta=",delta);
       }
     }
    /*
       0. delta=5.198186103783087e-09
       1. delta=8.927621308885136e-09
       2. delta=2.131878673594656e-09
       3. delta=1.0228555918923021e-09
       4. delta=2.0585739779477308e-09
       5. delta=-4.199390279957527e-09
       6. delta=-1.3221741035351897e-08
       7. delta=-1.742922250969059e-09
       8. delta=-8.770715820283215e-10
       9. delta=-1.2543186267421902e-08
    */
    //+------------------------------------------------------------------+
    //| Fills the vector with random values                              |
    //+------------------------------------------------------------------+
    void ArrayRandom(vector& v)
     {
      for(ulong i=0; i<v.Size(); i++)
        v[i]=double(MathRand())/32767.;
     }

  4. Added Activation and Derivative methods for matrices and vectors:
    AF_ELU               Exponential Linear Unit
    AF_EXP               Exponential
    AF_GELU              Gaussian Error Linear Unit
    AF_HARD_SIGMOID      Hard Sigmoid
    AF_LINEAR            Linear
    AF_LRELU             Leaky REctified Linear Unit
    AF_RELU              REctified Linear Unit
    AF_SELU              Scaled Exponential Linear Unit
    AF_SIGMOID           Sigmoid
    AF_SOFTMAX           Softmax
    AF_SOFTPLUS          Softplus
    AF_SOFTSIGN          Softsign
    AF_SWISH             Swish
    AF_TANH              Hyperbolic Tangent
    AF_TRELU             Thresholded REctified Linear Unit
    The neural network activation function determines how the weighted input signal sum is converted into a node output signal at the network level. The selection of the activation function has a big impact on the neural network performance. Different parts of the model can use different activation functions. In addition to all known functions, MQL5 also offers derivatives. Derivative functions enable fast calculation of adjustments based on the error received in learning.

  5. Added Loss function for matrices and vectors. It has the following parameters:
    LOSS_MSE            Mean Squared Error
    LOSS_MAE            Mean Absolute Error
    LOSS_CCE            Categorical Crossentropy
    LOSS_BCE            Binary Crossentropy
    LOSS_MAPE           Mean Absolute Percentage Error
    LOSS_MSLE           Mean Squared Logarithmic Error
    LOSS_KLD            Kullback-Leibler Divergence
    LOSS_COSINE         Cosine similarity/proximity
    LOSS_POISSON        Poisson
    LOSS_HINGE          Hinge
    LOSS_SQ_HINGE       Squared Hinge
    LOSS_CAT_HINGE      Categorical Hinge
    LOSS_LOG_COSH       Logarithm of the Hyperbolic Cosine
    LOSS_HUBER          Huber
    The loss function evaluates the quality of model predictions. The model construction targets the minimization of the function value at each stage. The approach depends on the specific dataset. Also, the loss function can depend on weight and offset. The loss function is one-dimensional and is not a vector since it provides a general evaluation of the neural network.

  6. Added matrix::CompareByDigits and vector::CompareByDigits methods for matrices and vectors. They compare the elements of two matrices/vectors up to significant digits.

  7. Added support for MathMin and MathMax functions for strings. The functions will use lexicographic comparison: letters are compared alphabetically, case sensitive.

  8. The maximum number of OpenCL objects has been increased from 256 to 65536. OpenCL object handles are created in an MQL5 program using the CLContextCreate, CLBufferCreate and CLProgramCreate functions. The previous limit of 256 handles was not enough for the efficient use of machine learning methods.

  9. Added ability to use OpenCL on graphical card without 'double' support. Previously, only GPUs supporting double were allowed in MQL5 programs, although many tasks allow calculations using float. The float type is initially considered native for parallel computing, as it takes up less space. Therefore, the old requirement has been lifted.

    To set the mandatory use of GPUs with double support for specific tasks, use the CL_USE_GPU_DOUBLE_ONLY in the CLContextCreate call.
       int cl_ctx;
    //--- Initializing the OpenCL context
       if((cl_ctx=CLContextCreate(CL_USE_GPU_DOUBLE_ONLY))==INVALID_HANDLE)
         {
          Print("OpenCL not found");
          return;
         }

  10. Fixed operation of the CustomBookAdd function. Previously, a non-zero value in the MqlBookInfo::volume_real field prevented the function from creating a Market Depth snapshot. The check is now performed as follows:
    The transmitted data is validated: type, price and volume data must be specified for each element. Also, MqlBookInfo.volume and MqlBookInfo.volume_real must not be zero or negative. If both volumes are negative, this will be considered an error. You can specify any of the volume types or both of them, while the system will use the one that is indicated or is positive:

       volume=-1 && volume_real=2 — volume_real=2 will be used,

       volume=3 && volume_real=0 — volume=3 will be used.

    Increased-precision volume MqlBookInfo.volume_real has a higher priority than MqlBookInfo.volume. Therefore, if both values are specified and are valid, volume_real will be used.

    If any of the Market Depth elements is described incorrectly, the system will discard the transferred state completely.

  11. Fixed operation of the CalendarValueLast function. Due to an error, successive function calls after changes in the Economic Calendar (the 'change' parameter was set a new value after the call) could skip some events when using the currency filter.
    CalendarValueLast(change, result, "", "EUR")
  12. Fixed ArrayBSearch function behavior. If multiple identical elements are found, a link to the first result will be returned, rather than a random one.
  13. Fixed checks for template function visibility within a class. Due to an error, class template functions declared as private/protected appeared to be public.

MetaEditor

  1. Fixed errors and ambiguous behavior of MetaAssist.
  2. Added support for the %terminal% macros which indicates the path to the terminal installation directory. For example, %terminal%\MQL5\Experts. 

    Added support for the %terminal% macros which indicates the path to the terminal installation directory.

  3. Improved display of arrays in the debugger.
  4. Increased buffer for copying values from the debugger.
  5. Improved error hints.
  6. Added indication of relative paths in the *.mproj project file. Previously, absolute paths were used, which resulted in compilation errors in case the project was moved.
  7. Added automatic embedding of BMP resources as globally available 32-bit bitmap arrays in projects. This eliminates the need to call ResourceReadImage inside the code to read the graphical resource.
    'levels.bmp' as 'uint levels[18990]'
    
  8. Improved reading of extended BMP file formats.
  9. Updated UI translations.
  10. Fixed errors reported in crash logs.

2 June 2022
MetaTrader 5 build 3320: Improvements and fixes

Terminal

  1. Extended tooltips for trade objects displayed on charts:
    • Market exit deals now display profits.
    • The relevant indication is displayed for deals executed as a result of Take Profit or Stop Loss activation.

    Similar tooltips are available for the lines joining entry and exit trades.

    Extended tooltips for deal objects


  2. Improved graphical system performance.
  3. Added logging of bulk operations with open orders and positions. When such a command is executed, a relevant log as added to the Journal, for example: "bulk closing of XXX positions started".
  4. Fixed bulk closing of opposite positions.
  5. Fixed updating of on-chart objects displaying trading history. The error occurred when changing the chart symbol.

MQL5

  1. Works on matrix and vector functions are underway: support for 'float' and 'complex' is being implemented.
  2. Operator "!" (LNOT) for a pointer checks its validity via an implicit CheckPointer call. Operator "==" should be used for a quick NULL check. For example: ptr==NULL or ptr!=NULL.

MetaTester

  1. Fixed display of deal objects on testing graphs.
  2. Improved graphical system performance.

MetaEditor

  • Updated UI translations.

Fixed errors reported in crash logs.

previous123456789101112131415