MetaTrader 5 Platform update build 3800: Book or Cancel orders, AI coding assistant, and enhanced ONNX support

 

The MetaTrader 5 platform update will be released on Thursday, June 8, 2023.

In the new version, we have added support for Book or Cancel orders. Such orders can only be placed in the Depth of Market, but they cannot be filled immediately. They are used to implement passive exchange trading.

In the new MetaEditor version, we have implemented integration with Copilot, an AI-powered coding assistant. You can write a trading idea in a natural language, and Copilot will offer its MQL5 implementation.

Also, the new version provides significantly enhanced support for operations with ONNX machine learning models. These models can be opened directly in MetaEditor through the built-in viewer or through the specialized Netron viewer.

MetaTrader 5 Platform update build 3800: Book or Cancel orders, AI coding assistant, and enhanced ONNX support

The updated web terminal displays balance transactions and totals in the history section and is available in 24 languages.

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.
The update provides the following changes:


MetaTrader 5 Client Terminal build 3800

  1. Terminal: 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. Terminal: 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. Terminal: 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. Terminal: 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. Terminal: 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. Terminal: Implemented faster rendering of indicators with the DRAW_COLOR_CANDLES display style.
  7. Terminal: Fixed trading report creation errors. On-chart profit and equity values could be displayed incorrectly under certain conditions.
  8. Terminal: 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. Terminal: Updated UI translations.
  10. Terminal: Improved stability under Wine, especially on macOS systems. We recommend completely removing old terminals and re-installing them:


  11. Terminal: Accelerated package installation and updates downloading procedures. Improved analysis of AVX availability on the user's computer when selecting a distribution package.
  12. Terminal: Enabled support for TLS 1.3 in web protocols. TLS 1.0 is considered deprecated and insecure and has therefore been disabled.
  13. Terminal: Fixed accounting for agent commissions in trading history reports. The relevant transactions could be ignored when calculating the final profit.
  14. Terminal: 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.
  15. MQL5: 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.
  16. MQL5: 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
       );
  17. MQL5: 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


  18. MQL5: 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.

  19. MQL5: 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.

  20. MQL5: Improved support for ONNX models.
  21. MQL5: 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);
  22. MQL5: Fixed operations with arrays having two or more dimensions in the FrameAdd and FrameNext methods.
  23. MQL5: Fixed CRedBlackTree::Remove Standard Library method.
  24. MQL5: Implemented fixes in the Fuzzy Logic library.
  25. MetaEditor: 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.

  26. MetaEditor: 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


  27. MetaEditor: 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

  28. MetaEditor: Updated UI translations.
  29. Tester: 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.
  30. Tester: Improved custom commission options in the strategy tester. To set a symbol, specify its name rather than the entire path.
  31. Tester: Updated icons in the strategy tester. New metaphors will make them easier to understand.
  32. Fixed errors reported in crash logs.

MetaTrader 5 Web Terminal build 3800

  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


The update will be available through the Live Update system.

 
Sergey Golubev # :

Great, but the only problem when creating the prompt "//Function for checking order state" it create checking order using mql4 language :

But I think it's fun :)

 

AlsoI think Metaquotes have a typo , should be Prompt not Promt


 
Tester really needs a lot of update.
 
A suggestion for using AI to write code. Experienced coders would probably benefit more from an AI support, if it were to add "what is this code doing"-comments, and supporting the documentation of code snippets as well as functions.

Maybe even add the relevant "comment" parts to functions such that a seemless usage of "Doxygen" would work.

Doxygen is a tool to parse source code and generate a documentation from the code.

Also refactoring support by AI would be a very helpful tool, especially on larger projects.

Usually, I don't need support in writing code, but documentation would be really nice to have automated.


 

Hi,

Thank you very much for these updates!

Concerning MetaTrader 5 Web Terminal, I can't find any broker that is offering it yet, I have contacted about 10 brokers. Some of the responses I got :

"The updates related to the MetaQuotes platforms are not pushed by us, but by MetaQuotes, so we are not sure when will the next one be"

"Unfortunately there are no updates from MetaQuotes yet and no ETA has been given"


 
karlson3 #:

"The updates related to the MetaQuotes platforms are not pushed by us, but by MetaQuotes, so we are not sure when will the next one be"

"Unfortunately there are no updates from MetaQuotes yet and no ETA has been given"

They can launch it anytime, it's only up to them.
 
Alexey Petrov #:
They can launch it anytime, it's only up to them.

Isn't that a beta (currently 3771) ?  3771 is unusable for me as it can't compile my production code (which compile fine in 3661).

Hopefully broker can't push beta build.

 
Alain Verleyen #:

Isn't that a beta (currently 3771) ?  3771 is unusable for me as it can't compile my production code (which compile fine in 3661).

Hopefully broker can't push beta build.

Yes, this is a beta release, but that's not what I meant.

If I understand @karlson3 correctly, the brokers are not providing the new web terminal at all (not this specific version, but in general). So what I'm saying is that they can do it.

 
Alexey Petrov #:

Yes, this is a beta release, but that's not what I meant.

If I understand @karlson3 correctly, the brokers are not providing the new web terminal at all (not this specific version, but in general). So what I'm saying is that they can do it.

Thanks. I think all is clear now.
 

Metatrader 5 update , the application can't launch with the warning said "The procedure entry point Eventsetinformation could not be located in the dynamic link library ADVAPI32.dll" . I'm using windows 7 64 bit system , I still can use metatrader 5 on build 3661 . What's the point of update if the update break the program for a lot of people ?  me windows 7 user , post above me alain verleyen his code broken . 



Reason: