Codes

Examples from the book "Neural networks for algorithmic trading with MQL5" for MetaTrader 5

The book "Neural networks in algorithmic trading with MQL5" is a comprehensive guide, covering both the theoretical foundations of artificial intelligence and neural networks and practical aspects of their application in financial trading using the MQL5 programming language

MQL5 Programming for Traders – Source Codes from the Book. Part 7 for MetaTrader 5

The final seventh part of the book discusses the advanced capabilities of the MQL5 API, which will be useful when developing programs for MetaTrader 5. These include custom financial symbols, built-in economic calendar events, and general-purpose technologies such as networking, databases, and

MQL5 Programming for Traders – Source Codes from the Book. Part 6 for MetaTrader 5

In Part 6 of the "MQL5 Programming for Traders", we will study a key component of the MQL5 language – trading automation. We will start with a description of the fundamental entities, such as financial instrument specifications and trading account settings. These are prerequisites for creating

MQL5 Programming for Traders – Source Codes from the Book. Part 5 for MetaTrader 5

In Part 5 of the book, we'll delve deeper into the APIs associated with algorithmic trading, including financial data analysis and processing, chart visualization, automation, and user interactions

MQL5 Programming for Traders – Source Codes from the Book. Part 4 for MetaTrader 5

In the fourth part of the book, we will focus on mastering built-in functions (MQL5 API) and will gradually delve into specialized subsystems. Any MQL5 program can utilize a plethora of technologies and functionalities. Therefore, it makes sense to begin with the most simple and useful functions

MQL5 Programming for Traders – Source Codes from the Book. Part 3 for MetaTrader 5

Part 3 "Object Oriented Programming in MQL5" offers an immersion into the world of object-oriented programming (OOP) in the MQL5 language. Software development often involves the complexity related to the management of multiple entities, requiring advanced technology to improve programming

MQL5 Programming for Traders – Source Codes from the Book. Part 2 for MetaTrader 5

Part 2 "MQL5 programming fundamentals" is an introduction to the key concepts of this programming language. This part of the book is devoted to data types, identifiers, variables, expressions, and operators. You will learn how to combine different instructions to form the program logic

MQL5 Programming for Traders – Source Codes from the Book. Part 1 for MetaTrader 5

The first chapter of the book introduces the MQL5 language and development environment. One of the new features introduced in the MQL5 language compared to MQL4 (MetaTrader 4 language) is support for object-oriented programming (OOP), which makes it similar to C++

Zigzag R for MetaTrader 4

An optimized version of the Zigzag indicator, which was included in the MT4 delivery of 2005 (and in MT3.83)

RegularExpressions in MQL4 for working with regular expressions for MetaTrader 4

Regular expressions provide a formal language for quick and flexible processing of texts. Each regular expression is a pattern (mask), for which the regular expression engine tries to find matches in the source text. A pattern consists of one or more character literals, operators, or constructs

Articles

Working with ONNX models in float16 and float8 formats for MetaTrader 5

Data formats used to represent machine learning models play a crucial role in their effectiveness. In recent years, several new types of data have emerged, specifically designed for working with deep learning models. In this article, we will focus on two new data formats that have become widely

Regression models of the Scikit-learn Library and their export to ONNX for MetaTrader 5

In this article, we will explore the application of regression models from the Scikit-learn package, attempt to convert them into ONNX format, and use the resultant models within MQL5 programs. Additionally, we will compare the accuracy of the original models with their ONNX versions for both float

Launching MetaTrader VPS: A step-by-step guide for first-time users for MetaTrader 5

Everyone who uses trading robots or signal subscriptions sooner or later recognizes the need to rent a reliable 24/7 hosting server for their trading platform. We recommend using MetaTrader VPS for several reasons. You can conveniently pay and manage the subscription through your MQL5.community

Classification models in the Scikit-Learn library and their export to ONNX for MetaTrader 5

In this article, we will explore the application of all classification models available in the Scikit-Learn library to solve the classification task of Fisher's Iris dataset. We will attempt to convert these models into ONNX format and utilize the resulting models in MQL5 programs. Additionally, we

ALGLIB numerical analysis library in MQL5 for MetaTrader 5

The article takes a quick look at the ALGLIB 3.19 numerical analysis library, its applications and new algorithms that can improve the efficiency of financial data analysis

Evaluating ONNX models using regression metrics for MetaTrader 5

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

Matrices and vectors in MQL5: Activation functions for MetaTrader 5

Here we will describe only one of the aspects of machine learning - activation functions. In artificial neural networks, a neuron activation function calculates an output signal value based on the values of an input signal or a set of input signals. We will delve into the inner workings of the

Wrapping ONNX models in classes for MetaTrader 5

Object-oriented programming enables creation of a more compact code that is easy to read and modify. Here we will have a look at the example for three ONNX models

An example of how to ensemble ONNX models in MQL5 for MetaTrader 5

ONNX (Open Neural Network eXchange) is an open format built to represent neural networks. In this article, we will show how to use two ONNX models in one Expert Advisor simultaneously

How to use ONNX models in MQL5 for MetaTrader 5

ONNX (Open Neural Network Exchange) is an open format built to represent machine learning models. In this article, we will consider how to create a CNN-LSTM model to forecast financial timeseries. We will also show how to use the created ONNX model in an MQL5 Expert Advisor

Forum

Discussing the article: "Neural networks made easy (Part 68): Offline Preference-guided Policy Optimization"

Check out the new article: Neural networks made easy (Part 68): Offline Preference-guided Policy Optimization . Since the first articles devoted to reinforcement learning, we have in one way or another touched upon 2 problems: exploring the environment and determining the reward function. Recent

Discussing the article: "Developing a Replay System (Part 36): Making Adjustments (II)"

Check out the new article: Developing a Replay System (Part 36): Making Adjustments (II) . One of the things that can make our lives as programmers difficult is assumptions. In this article, I will show you how dangerous it is to make assumptions: both in MQL5 programming, where you assume that the

Discussing the article: "How to build and optimize a volatility-based trading system (Chaikin Volatility - CHV)"

Check out the new article: How to build and optimize a volatility-based trading system (Chaikin Volatility - CHV) . In this article, we will provide another volatility-based indicator named Chaikin Volatility. We will understand how to build a custom indicator after identifying how it can be used

Discussing the article: "Population optimization algorithms: Micro Artificial immune system (Micro-AIS)"

Check out the new article: Population optimization algorithms: Micro Artificial immune system (Micro-AIS) . The article considers an optimization method based on the principles of the body's immune system - Micro Artificial Immune System (Micro-AIS) - a modification of AIS. Micro-AIS uses a simpler

Discussing the article: "Developing a Replay System (Part 35): Making Adjustments (I)"

Check out the new article: Developing a Replay System (Part 35): Making Adjustments (I) . Before we can move forward, we need to fix a few things. These are not actually the necessary fixes but rather improvements to the way the class is managed and used. The reason is that failures occurred due to

Discussing the article: "Building A Candlestick Trend Constraint Model (Part 1): For EAs And Technical Indicators"

Check out the new article: Building A Candlestick Trend Constraint Model (Part 1): For EAs And Technical Indicators . This article is aimed at beginners and pro-MQL5 developers. It provides a piece of code to define and constrain signal-generating indicators to trends in higher timeframes. In this

Discussing the article: "Creating a market making algorithm in MQL5"

Check out the new article: Creating a market making algorithm in MQL5 . How do market makers work? Let's consider this issue and create a primitive market-making algorithm. Many people think that a market maker does not bear any risks at all. However, this is not the case. The main risk of a market

Discussing the article: "A Generic Optimization Formulation (GOF) to Implement Custom Max with Constraints"

Check out the new article: A Generic Optimization Formulation (GOF) to Implement Custom Max with Constraints . In this article we will present a way to implement optimization problems with multiple objectives and constraints when selecting "Custom Max" in the Setting tab of the MetaTrader 5

Discussing the article: "Population optimization algorithms: Bacterial Foraging Optimization - Genetic Algorithm (BFO-GA)"

Check out the new article: Population optimization algorithms: Bacterial Foraging Optimization - Genetic Algorithm (BFO-GA) . The article presents a new approach to solving optimization problems by combining ideas from bacterial foraging optimization (BFO) algorithms and techniques used in the

Discussing the article: "Developing a Replay System (Part 34): Order System (III)"

Check out the new article: Developing a Replay System (Part 34): Order System (III) . In this article, we will complete the first phase of construction. Although this part is fairly quick to complete, I will cover details that were not discussed previously. I will explain some points that many do