How to Start with MT5, a summary ! - page 8

 

How will this affect Market products in the future?

I am assuming that the validation process will require that the product should be compiled without it to cater for the lowest common denominator.

 
Fernando Carreiro # : How will this affect Market products in the future? I am assuming that the validation process will require that the product should be compiled without it to cater for the lowest common denominator.

Forum on trading, automated trading systems and testing trading strategies

Compiling MQL5 programs with the AVX / AVX2 + FMA3 / AVX512 + FMA3 instruction set with build 3902

Renat Fatkhullin , 2023.09.01 13:24

Only programs compiled in "x64 Regular" mode will be accepted into the market.

Most likely in the future we will expand the opportunities in the market.

MT5 release is scheduled for Friday next week. Therefore, we ask you to actively test new modes.

 

Forum on trading, automated trading systems and testing trading strategies

Compiling MQL5 programs with the AVX / AVX2 + FMA3 / AVX512 + FMA3 instruction set with build 3902

Renat Fatkhullin , 2023.09.01 18:28

In the current beta 3905, available on MetaQuotes-Demo, we have expanded the information for MQL5:

 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

You can find out on the fly the capabilities of the processor on which the terminal is running.

Using the string macro __CPU_ARCHITECTURE__ you can find out and check for which set of commands the EX5 file was compiled.


If the download fails, it says:

your CPU architecture does not allow to run the file 'test.ex5', AVX512 required, you have AVX2

-------------------------

Something about MQL5 Cloud Network and MQL5 VPS in relation to AVX512 and AVX2 - 

Forum on trading, automated trading systems and testing trading strategies

Compiling MQL5 programs with the AVX / AVX2 + FMA3 / AVX512 + FMA3 instruction set with build 3902

Fernando Carreiro , 2023.09.01 19:15

What about the MetaQuotes VPS service? Will they all serve code compiled with extra instruction sets, or just regular compilation?

English original: What about MetaQuotes VPS service? Will they all also cater for code compiled with the extra instruction sets or only the regular compilation?

and the replies:

Forum on trading, automated trading systems and testing trading strategies

Compiling MQL5 programs with AVX / AVX2 + FMA3 / AVX512 + FMA3 instructions from build 3902

Renat Fatkhullin , 2023.09.01 19:22

In MetaQuotes VPS, we have modern processors with AVX2 everywhere. Therefore, migration will not be a problem.

But AVX512 versions will not be allowed in MQL5 Cloud Network or MetaQuotes VPS.

Forum on trading, automated trading systems and testing trading strategies

Compiling MQL5 programs with the AVX / AVX2 + FMA3 / AVX512 + FMA3 instruction set with build 3902

Renat Fatkhullin , 2023.09.06 08:41

By default everything is compiled in normal X64 mode. For those who know nothing and compile downloaded programs as is, nothing will change.

For those who want to move forward, there are all possibilities. Over the course of two releases, all terminals will automatically be divided into three versions: x64, avx and avx2 - this is written in the start banner of the terminal. For a couple of years now, terminals have been distributed in two versions, x64 and avx.

When distributing programs, including the market, you need to build the x64 version. The remaining options are for your controlled use. Finding out what set of instructions is in a vps server is not a problem.

At MetaTrader VPS Hosting, the last few servers without AVX2 support will be replaced with modern ones by the end of the week and it will be possible to migrate x64/avx/avx2 programs to our cloud without any problems. On third-party VPS, just check the brand of the processor, use the CPU-Z program or look at the start banner of the terminal.

An explicit transition to specialized versions of terminals for modern processors is a big and correct step. We are seriously focused on improving the performance of the entire platform and now we have a free hand to directly implement new optimization methods without building crutches.

Forum on trading, automated trading systems and testing trading strategies

Compiling MQL5 programs with the AVX / AVX2 + FMA3 / AVX512 + FMA3 instruction set with build 3902

Renat Fatkhullin , 2023.09.09 16:58

MetaTrader VPS Hosting is completely on AVX2 versions.

MetaTrader 5 terminals in the cloud are launched immediately in AVX2 builds:

Windows Server 2022 build 20348 on Xen, 32 x AMD EPYC 7542 32 -Core, AVX2 , 61  / 71 Gb memory, 149  / 255 Gb disk, admin, GMT+ 1

-------------------------


Forum on trading, automated trading systems and testing trading strategies

Compiling MQL5 programs with the AVX / AVX2 + FMA3 / AVX512 + FMA3 instruction set with build 3902

Renat Fatkhullin , 2023.09.06 13:07

In MQL5 Cloud Network, the upper limit for EX5 will be AVX2 and tasks will be automatically distributed to agents with the required processor set.

That is, everything will work transparently in a couple of days. Tomorrow we are releasing an open beta for brokers, and a week later there will be a release.


Forum on trading, automated trading systems and testing trading strategies

Compiling MQL5 programs with the AVX / AVX2 + FMA3 / AVX512 + FMA3 instruction set with build 3902

Renat Fatkhullin , 2023.09.06 13:58

...

We are planning a major upgrade of the MQL5 compiler with more complete support for the AVX2/512 instruction set over the next two months. Plus optimization of the internal functions of the language, which will give good acceleration.

 

visual studio

The question:

Forum on trading, automated trading systems and testing trading strategies

Compiling MQL5 programs with AVX / AVX2 + FMA3 / AVX512 + FMA3 instructions from build 3902

Renat Akhtyamov , 2023.09.07 12:40

Good afternoon, the developers!

what does install visual studio mean and what will it allow, if not write in C# for example?

..and the reply:

Forum on trading, automated trading systems and testing trading strategies

Compiling MQL5 programs with the AVX / AVX2 + FMA3 / AVX512 + FMA3 instruction set with build 3902

Renat Fatkhullin , 2023.09.07 13:07

Once you install Visual Studio, you can compile C/C++ files directly into MetaEditor.

For example, this allows you to easily compile EXE files or DLL libraries directly within MQL5 projects/directories:


------------------------

The announcement:

MetaTrader 5 Platform Beta Build 3930: Deposits/withdrawals in the terminal and support for AVX instructions to speed up programs


MetaTrader 5 Platform Beta Build 3930: Deposits/withdrawals in the terminal and support for AVX instructions to speed up programs
MetaTrader 5 Platform Beta Build 3930: Deposits/withdrawals in the terminal and support for AVX instructions to speed up programs
  • 2023.09.07
  • www.mql5.com
The beta version of the updated MetaTrader 5 platform is to be released on Friday, September 8, 2023...
 

Forum on trading, automated trading systems and testing trading strategies

New MetaTrader 5 Platform build 3980: Improvements and fixes

MetaQuotes, 2023.09.21 15:01

The updated version of the MetaTrader 5 platform will be released on Thursday, September 21, 2023. It features a number of platform fixes and improvements.

New MetaTrader 5 Platform build 3980: Improvements and fixes


MetaTrader 5 Client Terminal build 3980

  1. Terminal: New trading report improvements. Fixed the display of the total swaps value and the profit chart by symbols.
  2. Terminal: Optimized deposit and withdrawal pages. For further details about the new platform integration with payment systems, please read the build 3950 release notes.
  3. Terminal: Optimized recalculations of financial operations across the entire platform, including the strategy tester. Now profit, margins, and many other parameters are calculated faster.
  4. Terminal: Updated user interface translations.
  5. MQL5: 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)]]
       */
      }
  6. MQL5: 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);
  7. MetaEditor: 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.


The update will be available through the Live Update system.


 

ONNX and  MQL5 Copilot


The forum

  1. MetaEditor, Open AI and ChatGPT - summary thread
  2. Learning ONNX for trading - key forum thread about ONNX
  3. Practical examples: this page

    CodeBase

    1. Information about the ONNX model's inputs and outputs - script for MetaTrader 5
    2. Get info about inputs and outputs of onnx-model - script for MetaTrader 5

    Documentation

    1. ONNX models in machine learning (MT5)

    Learning ONNX for trading - the video:

    1. ONNX Runtime - post  #60
    2. Converting Models to #ONNX Format - post  #61
    3. ONNX – open format for machine learning models​ - post #62
    4. (Deep) Machine Learned Model Deployment with ONNX - post  #63
    5. Recurrent Neural Networks | LSTM Price Movement Predictions For Trading Algorithms- post 
    6. Artificial Intelligence Full Course | Artificial Intelligence Tutorial for Beginners | Edureka - post  #230
    7. Open Neural Network Exchange (ONNX):
      7.1. Introduction to ONNX - Tutorial 1 - post
      7.2. Challenges in Deep Learning - Tutorial 2 - post
      7.3. All about ONNX - Tutorial 3 - post
      7.4. Design principles - Tutorial 4 - post
      7.5. ONNX file format - Tutorial 5 - post
      7.6. ONNX Data Type - Tutorial 6 - post
      7.7. Machine Learning Example - Tutorial 7 - post
      7.8. ONNX Runtime - Tutorial 8 - post
      7.9. ONNX Model Zoo - Tutorial 9 - post
      7.10. ONNX Model Zoo Demo - Tutorial 10 - post
      7.11. PyTorch to Tensorflow Demo - Tutorial 11 - post
    8. MIT Introduction to Deep Learning:
      8.1. Introduction to Deep Learning - Lecture 1 - post
      8.2. Recurrent Neural Networks and Transformers -  Lecture 2 - post
      8.3. Convolutional Neural Networks - Lecture 3 - post 
      8.4. Deep Generative Modeling -  Lecture 4 - post
      8.5. Reinforcement Learning -  Lecture 5 - post
      8.6. Deep Learning New Frontiers -  Lecture 6 - post
      8.7. LiDAR for Autonomous Driving -  Lecture 7 - post
      8.8. Automatic Speech Recognition -  Lecture 8 - post
      8.9. AI for Science -  Lecture 9 - post
      8.10. Uncertainty in Deep Learning -  Lecture 10 - post

    =======================

    Evaluating ONNX models using regression metrics 

    Evaluating ONNX models using regression metrics

    Regression is a task of predicting a real value from an unlabeled example. A well-known example of regression is estimating the value of a diamond based on such characteristics as size, weight, color, clarity, etc.

    The so-called regression metrics are used to assess the accuracy of regression model predictions. Despite similar algorithms, regression metrics are semantically different from similar loss functions.

    Evaluating ONNX models using regression metrics
    Evaluating ONNX models using regression metrics
    • www.mql5.com
    Regression is a task of predicting a real value from an unlabeled example. The so-called regression metrics are used to assess the accuracy of regression model predictions.
     
    Thanks for this summary!
     

    Forum on trading, automated trading systems and testing trading strategies

    How to start with MQL5

    Sergey Golubev, 2024.03.23 06:33

    Master MQL5 from beginner to pro (Part I): Getting started with programming

    Master MQL5 from beginner to pro (Part I): Getting started with programming

    I sometimes receive private messages from those who want to learn how to create their own Expert Advisors or indicators. Although there is a lot of material on this site and on the Internet in general, including very good resources with examples, beginners still need help. Some users seek more consistency in presentation, others require clarity or something else. Sometimes users ask: "Add comments to the code of a working Expert Advisor, I will understand everything and make the same one myself!" But, after they see a hundred lines of code, they get scared, confused and give up the idea. Instead, they say: "Better create an Expert Advisor for me."

    Anyway, there are people who still want to "understand everything". This is when a step-by-step guide, explaining things from simple to complex, may come in handy. Well, users can't find such a step-by-step guide for the MQL5 language.

    Master MQL5 from beginner to pro (Part I): Getting started with programming

    I am starting this series of articles specifically for beginners, for those who are encountering programming for the first time and are willing to learn it. These articles are intended for traders who no longer want to depend on programmers and wish to understand how everything works. The articles offer consistent and detailed information, with pictures and examples, guiding readers to the level of "MQL5 language proficiency".


     

    Forum on trading, automated trading systems and testing trading strategies

    Subscribe to real-time Nasdaq data

    MetaQuotes, 2024.09.19 14:35

    Use detailed Nasdaq data to enhance your trading strategies through more accurate decision-making and efficient risk management. This is a unique opportunity for those looking to improve their results. Unlike traditional minute or hourly bars, the subscription offers access to tick data, providing information on every price change and enabling deeper market analysis.

    Subscribe to real-time Nasdaq data

    What you gain with the subscription:

    • Accuracy – receive high-quality data on every price change to achieve more accurate strategy testing results and minimize the risk of errors.
    • Depth – access up to 20 years of tick history to evaluate asset behavior in different market conditions and better prepare for volatility.
    • Instant reactions – real-time market data allows you to promptly respond to changes, which is critical in active trading environments.

    Four subscription plans are available to meet different needs: real-time data without historical access and real-time data with history for 12 months, 36 months or 20 years. Subscription plans are divided into professional and non-professional.

    Non-professional plans are suited for individuals who use data for personal, non-commercial purposes to manage personal assets, not for third parties. Nasdaq Pro plans are intended for individuals or organizations using the data for commercial purposes, trading on behalf of employers or adding value. Registered investment advisers are also classified as professionals.

    How to test this new feature for free:

    1. Open a new demo account on the MetaQuotes-Demo server. To do this, select MetaQuotes Ltd from the list of companies or find it using the search. Next, select "Open a demo account" and specify the desired server and your details.
    2. Open a new demo account on the MetaQuotes-Demo server

    3. In the Market Watch window, click the Plus icon to add any required symbol by starting to type the symbol or company name in the search field.
    4. Once the desired symbol appears in the list, select it with your mouse and press Enter. The symbol will appear in the list of symbols in the Market Watch.
    5. Right-click on this symbol and select "Chart Window" from the menu.

    Right-click on this symbol and select 'Chart Window' from the menu

    Without a subscription, you will receive data with a 15-minute delay and will not have access to the tick history of price changes. To subscribe to real-time data, double-click on the symbol. A window with available subscription plans will open.

    Select a suitable plan and connect the subscription to your demo account in MetaTrader 5

    Select a suitable plan and connect the subscription to your demo account in MetaTrader 5 to test your trading strategies using real data, conduct technical analysis or create custom indicators:

    • Use Nasdaq data to validate signals from other indicators. High-precision tick data enables a more accurate evaluation of signals from various technical indicators. Confirm or disprove their effectiveness based on real market movements – this can improve your trading strategies and reduce the likelihood of wrong decisions.
    • Combine data with MetaTrader 5 tools for advanced technical analysis. Real-time tick data combined with the platform's extensive toolkit enables in-depth market analysis. Use oscillators, trend and volume indicators along with Nasdaq data to make better-informed decisions.
    • Create your own indicators and Expert Advisors. With access to the detailed tick data, you can build and test unique trading algorithms that capture the smallest market fluctuations.