Discussing the article: "From Matrices to Models: How to Build an ML Pipeline in MQL5 and Export It to ONNX"

 

Check out the new article: From Matrices to Models: How to Build an ML Pipeline in MQL5 and Export It to ONNX.

The article describes the arrangement of a coordinated ML pipeline in MetaTrader 5 with separation of roles: Python trains and exports the model to ONNX, MQL5 reproduces normalization and PCA via matrix/vector and performs inference. This approach makes the model's inputs stable and verifiable, and the MetaTrader 5 strategy tester provides metrics for analyzing the system behavior.

What makes Machine learning (ML) in the terminal intimidating is not so much the model itself as everything around it. It might seem that we cannot do without a separate stack, Python scripts and complex integration. As a result we get a feeling that ML is something external in relation to MetaTrader 5.

But once we remove the extra layers, the picture becomes clearer. Any ML pipeline is a sequence of basic operations: generate features, scale them, remove redundancy, and pass the result to the model. This is not the magic of neural networks, but ordinary linear algebra.

In this article we will go through this path sequentially without unnecessary theory based on matrices and vectors as the main tool. The focus is on the main goal: how to achieve results that are reproducible both in training and in a real trading environment.

ML pipeline


Author: MetaQuotes

 
IMHO, normalising and calculating PCA on the whole dataset and only then splitting it into training and validation samples means looking into the future. When working online you don't have the ability to change the normalisation or adapt the PCA to the latest data. A fair experiment would be to initially split the data into two sets and then normalise+PCA on the in-sample part only, and then apply the metaparameters found to transform the input data on the out-of-sample.
 
Stanislav Korotky #:
IMHO, normalising and calculating PCA on the whole dataset and only then splitting it into training and validation samples means looking into the future. When working online you don't have the ability to change the normalisation or adapt the PCA to the latest data. An honest experiment would be to initially split the data into two sets and then normalise+PCA only on the in-sample part, and then apply the metaparameters you found to transform the input data on the out-of-sample.
By the way, all chats sin with this, especially in wavelet decomposition with subsequent processing and training.

As a result, even a regular arrow indicator shows arrows "on the very turns".

Dangerous thing, you can't understand the catch at once.