MetaEditor HelpWorking with machine learning models

Working with machine learning models

The MQL5 language supports operations with ONNX (Open Neural Network Exchange) models. 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 MQL5 Documentation.

View models in MetaEditor #

You can view the contents of the ONNX model file (*.onnx) 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

View models in Netron #

Netron is a specialized viewer for ML models which enables the convenient visualization of their content. It 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