Articles on MetaTrader 5 integration using MQL5

icon

Traders meet interesting challenges which often require an innovative approach. This category features articles that offer the most unexpected solutions for evaluating, analyzing and processing price data and trading results. The articles describe various integration solutions, including connection of databases and ICQ, use of OpenCL and social networks, use of Delphi and C#.

Read on to learn how to use specialized mathematical and neural packages, and much more. Become an author and share unique ideas with the MQL5.community members.

Add a new article
latest | best
Payments and payment methods
Payments and payment methods

Payments and payment methods

MQL5.community Services offer great opportunities for traders as well as for the developers of applications for the MetaTrader terminal. In this article, we explain how payments for MQL5 services are performed, how the earned money can be withdraw, and how the operation security is ensured.
Migrating from MQL4 to MQL5
Migrating from MQL4 to MQL5

Migrating from MQL4 to MQL5

This article is a quick guide to MQL4 language functions, it will help you to migrate your programs from MQL4 to MQL5. For each MQL4 function (except trading functions) the description and MQL5 implementation are presented, it allows you to reduce the conversion time significantly. For convenience, the MQL4 functions are divided into groups, similar to MQL4 Reference.
Embed MetaTrader 4/5 WebTerminal on your website for free and make a profit
Embed MetaTrader 4/5 WebTerminal on your website for free and make a profit

Embed MetaTrader 4/5 WebTerminal on your website for free and make a profit

Traders are well familiar with the WebTerminal, which allows trading on financial markets straight from the browser. Add the WebTerminal widget to your website — you can do it absolutely free. If you have a website, you can start selling leads to brokers — we have prepared a ready-to-use web-based solution for you. All you need to do is embed one iframe into your website.
How to create Requirements Specification for ordering a trading robot
How to create Requirements Specification for ordering a trading robot

How to create Requirements Specification for ordering a trading robot

Are you trading using your own strategy? If your system rules can be formally described as software algorithms, it is better to entrust trading to an automated Expert Advisor. A robot does not need sleep or food and is not subject to human weaknesses. In this article, we show how to create Requirements Specification when ordering a trading robot in the Freelance service.
MQL as a Markup Tool for the Graphical Interface of MQL Programs (Part 3). Form Designer
MQL as a Markup Tool for the Graphical Interface of MQL Programs (Part 3). Form Designer

MQL as a Markup Tool for the Graphical Interface of MQL Programs (Part 3). Form Designer

In this paper, we are completing the description of our concept of building the window interface of MQL programs, using the structures of MQL. Specialized graphical editor will allow to interactively set up the layout that consists of the basic classes of the GUI elements and then export it into the MQL description to use it in your MQL project. The paper presents the internal design of the editor and a user guide. Source codes are attached.
MetaTrader 5 and Python integration: receiving and sending data
MetaTrader 5 and Python integration: receiving and sending data

MetaTrader 5 and Python integration: receiving and sending data

Comprehensive data processing requires extensive tools and is often beyond the sandbox of one single application. Specialized programming languages are used for processing and analyzing data, statistics and machine learning. One of the leading programming languages for data processing is Python. The article provides a description of how to connect MetaTrader 5 and Python using sockets, as well as how to receive quotes via the terminal API.
Securing MQL5 code: Password Protection, Key Generators, Time-limits, Remote Licenses and Advanced EA License Key Encryption Techniques
Securing MQL5 code: Password Protection, Key Generators, Time-limits, Remote Licenses and Advanced EA License Key Encryption Techniques

Securing MQL5 code: Password Protection, Key Generators, Time-limits, Remote Licenses and Advanced EA License Key Encryption Techniques

Most developers need to have their code secured. This article will present a few different ways to protect MQL5 software - it presents methods to provide licensing capabilities to MQL5 Scripts, Expert Advisors and Indicators. It covers password protection, key generators, account license, time-limit evaluation and remote protection using MQL5-RPC calls.
How to create bots for Telegram in MQL5
How to create bots for Telegram in MQL5

How to create bots for Telegram in MQL5

This article contains step-by-step instructions for creating bots for Telegram in MQL5. This information may prove useful for users who wish to synchronize their trading robot with a mobile device. There are samples of bots in the article that provide trading signals, search for information on websites, send information about the account balance, quotes and screenshots of charts to you smart phone.
Automata-Based Programming as a New Approach to Creating Automated Trading Systems
Automata-Based Programming as a New Approach to Creating Automated Trading Systems

Automata-Based Programming as a New Approach to Creating Automated Trading Systems

This article takes us to a whole new direction in developing EAs, indicators and scripts in MQL4 and MQL5. In the future, this programming paradigm will gradually become the base standard for all traders in implementation of EAs. Using the automata-based programming paradigm, the MQL5 and MetaTrader 5 developers will be anywhere near being able to create a new language - MQL6 - and a new platform - MetaTrader 6.
How to Access the MySQL Database from MQL5 (MQL4)
How to Access the MySQL Database from MQL5 (MQL4)

How to Access the MySQL Database from MQL5 (MQL4)

The article describes the development of an interface between MQL and the MySQL database. It discusses existing practical solutions and offers a more convenient way to implement a library for working with databases. The article contains a detailed description of the functions, the interface structure, examples and some of specific features of working with MySQL. As for the software solutions, the article attachments include the files of dynamic libraries, documentation and script examples for the MQL4 and MQL5 languages.
ZUP - Universal ZigZag with Pesavento patterns. Search for patterns
ZUP - Universal ZigZag with Pesavento patterns. Search for patterns

ZUP - Universal ZigZag with Pesavento patterns. Search for patterns

The ZUP indicator platform allows searching for multiple known patterns, parameters for which have already been set. These parameters can be edited to suit your requirements. You can also create new patterns using the ZUP graphical interfaces and save their parameters to a file. After that you can quickly check, whether these new patterns can be found on charts.
Using MetaTrader 5 Indicators with ENCOG Machine Learning Framework for Timeseries Prediction
Using MetaTrader 5 Indicators with ENCOG Machine Learning Framework for Timeseries Prediction

Using MetaTrader 5 Indicators with ENCOG Machine Learning Framework for Timeseries Prediction

This article presents connecting MetaTrader 5 to ENCOG - Advanced Neural Network and Machine Learning Framework. It contains description and implementation of a simple neural network indicator based on a standard technical indicators and an Expert Advisor based on a neural indicator. All source code, compiled binaries, DLLs and an exemplary trained network are attached to the article.
preview
How to create a graphical panel of any complexity level

How to create a graphical panel of any complexity level

The article features a detailed explanation of how to create a panel on the basis of the CAppDialog class and how to add controls to the panel. It provides the description of the panel structure and a scheme, which shows the inheritance of objects. From this article, you will also learn how events are handled and how they are delivered to dependent controls. Additional examples show how to edit panel parameters, such as the size and the background color.
Creating and testing custom symbols in MetaTrader 5
Creating and testing custom symbols in MetaTrader 5

Creating and testing custom symbols in MetaTrader 5

Creating custom symbols pushes the boundaries in the development of trading systems and financial market analysis. Now traders are able to plot charts and test trading strategies on an unlimited number of financial instruments.
Exposing C# code to MQL5 using unmanaged exports
Exposing C# code to MQL5 using unmanaged exports

Exposing C# code to MQL5 using unmanaged exports

In this article I presented different methods of interaction between MQL5 code and managed C# code. I also provided several examples on how to marshal MQL5 structures against C# and how to invoke exported DLL functions in MQL5 scripts. I believe that the provided examples may serve as a basis for future research in writing DLLs in managed code. This article also open doors for MetaTrader to use many libraries that are already implemented in C#.
Calculator of signals
Calculator of signals

Calculator of signals

The calculator of signals operates directly from the MetaTrader 5 terminal, which is a serious advantage, since the terminal provides a preliminary selection and sorts out signals. This way, users can see in the terminal only the signals that ensure a maximum compatibility with their trading accounts.
preview
How to make $1,000,000 off algorithmic trading? Use MQL5.com services!

How to make $1,000,000 off algorithmic trading? Use MQL5.com services!

All traders visit the market with the goal of earning their first million dollars. How to do that without excessive risk and start-up budget? MQL5 services provide such opportunity for developers and traders from around the world.
How to Exchange Data: A DLL for MQL5 in 10 Minutes
How to Exchange Data: A DLL for MQL5 in 10 Minutes

How to Exchange Data: A DLL for MQL5 in 10 Minutes

Now not so many developers remember how to write a simple DLL, and what are special features of different system binding. Using several examples, I will try to show the entire process of the simple DLL's creation in 10 minutes, as well as to discuss some technical details of our binding implementation. I will show the step-by-step process of DLL creation in Visual Studio with examples of exchanging different types of variables (numbers, arrays, strings, etc.). Besides I will explain how to protect your client terminal from crashes in custom DLLs.
Self-optimization of EA: Evolutionary and genetic algorithms
Self-optimization of EA: Evolutionary and genetic algorithms

Self-optimization of EA: Evolutionary and genetic algorithms

This article covers the main principles set fourth in evolutionary algorithms, their variety and features. We will conduct an experiment with a simple Expert Advisor used as an example to show how our trading system benefits from optimization. We will consider software programs that implement genetic, evolutionary and other types of optimization, and provide examples of application when optimizing a predictor set and parameters of the trading system.
How to Install and Use OpenCL for Calculations
How to Install and Use OpenCL for Calculations

How to Install and Use OpenCL for Calculations

It has been over a year since MQL5 started providing native support for OpenCL. However not many users have seen the true value of using parallel computing in their Expert Advisors, indicators or scripts. This article serves to help you install and set up OpenCL on your computer so that you can try to use this technology in the MetaTrader 5 trading terminal.
preview
SQLite: Native handling of SQL databases in MQL5

SQLite: Native handling of SQL databases in MQL5

The development of trading strategies is associated with handling large amounts of data. Now, you are able to work with databases using SQL queries based on SQLite directly in MQL5. An important feature of this engine is that the entire database is placed in a single file located on a user's PC.
MetaTrader 5 and MATLAB Interaction
MetaTrader 5 and MATLAB Interaction

MetaTrader 5 and MATLAB Interaction

This article covers the details of interaction between MetaTrader 5 and MatLab mathematical package. It shows the mechanism of data conversion, the process of developing a universal library to interact with MatLab desktop. It also covers the use of DLL generated by MatLab environment. This article is intended for experienced readers, who know C++ and MQL5.
Working with sockets in MQL, or How to become a signal provider
Working with sockets in MQL, or How to become a signal provider

Working with sockets in MQL, or How to become a signal provider

Sockets… What in our IT world could possibly exist without them? Dating back to 1982, and hardly changed up to the present time, they smoothly work for us every second. This is the foundation of network, the nerve endings of the Matrix we all live in.
Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs
Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs

Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs

Many developers face the same problem - how to get to the trading terminal sandbox without using unsafe DLLs. One of the easiest and safest method is to use standard Named Pipes that work as normal file operations. They allow you to organize interprocessor client-server communication between programs. Take a look at practical examples in C++ and MQL5 that include server, client, data exchange between them and performance benchmark.
preview
How to create 3D graphics using DirectX in MetaTrader 5

How to create 3D graphics using DirectX in MetaTrader 5

3D graphics provide excellent means for analyzing huge amounts of data as they enable the visualization of hidden patterns. These tasks can be solved directly in MQL5, while DireсtX functions allow creating three-dimensional object. Thus, it is even possible to create programs of any complexity, even 3D games for MetaTrader 5. Start learning 3D graphics by drawing simple three-dimensional shapes.
MQL as a Markup Tool for the Graphical Interface of MQL Programs. Part 1
MQL as a Markup Tool for the Graphical Interface of MQL Programs. Part 1

MQL as a Markup Tool for the Graphical Interface of MQL Programs. Part 1

This paper proposes a new conception to describe the window interface of MQL programs, using the structures of MQL. Special classes transform the viewable MQL markup into the GUI elements and allow manage them, set up their properties, and process the events in a unified manner. It also provides some examples of using the markup for the dialogs and elements of a standard library.
Adding a control panel to an indicator or an Expert Advisor in no time
Adding a control panel to an indicator or an Expert Advisor in no time

Adding a control panel to an indicator or an Expert Advisor in no time

Have you ever felt the need to add a graphical panel to your indicator or Expert Advisor for greater speed and convenience? In this article, you will find out how to implement the dialog panel with the input parameters into your MQL4/MQL5 program step by step.
Universal Expert Advisor: A Custom Trailing Stop (Part 6)
Universal Expert Advisor: A Custom Trailing Stop (Part 6)

Universal Expert Advisor: A Custom Trailing Stop (Part 6)

The sixth part of the article about the universal Expert Advisor describes the use of the trailing stop feature. The article will guide you through how to create a custom trailing stop module using unified rules, as well as how to add it to the trading engine so that it would automatically manage positions.
LifeHack for traders: Fast food made of indicators
LifeHack for traders: Fast food made of indicators

LifeHack for traders: Fast food made of indicators

If you have newly switched to MQL5, then this article will be useful. First, the access to the indicator data and series is done in the usual MQL4 style. Second, this entire simplicity is implemented in MQL5. All functions are as clear as possible and perfectly suited for step-by-step debugging.
Deep Neural Networks (Part V). Bayesian optimization of DNN hyperparameters
Deep Neural Networks (Part V). Bayesian optimization of DNN hyperparameters

Deep Neural Networks (Part V). Bayesian optimization of DNN hyperparameters

The article considers the possibility to apply Bayesian optimization to hyperparameters of deep neural networks, obtained by various training variants. The classification quality of a DNN with the optimal hyperparameters in different training variants is compared. Depth of effectiveness of the DNN optimal hyperparameters has been checked in forward tests. The possible directions for improving the classification quality have been determined.
Native Twitter Client for MT4 and MT5 without DLL
Native Twitter Client for MT4 and MT5 without DLL

Native Twitter Client for MT4 and MT5 without DLL

Ever wanted to access tweets and/or post your trade signals on Twitter ? Search no more, these on-going article series will show you how to do it without using any DLL. Enjoy the journey of implementing Twitter API using MQL. In this first part, we will follow the glory path of authentication and authorization in accessing Twitter API.
Integrating MQL-based Expert Advisors and databases (SQL Server, .NET and C#)
Integrating MQL-based Expert Advisors and databases (SQL Server, .NET and C#)

Integrating MQL-based Expert Advisors and databases (SQL Server, .NET and C#)

The article describes how to add the ability to work with Microsoft SQL Server database server to MQL5-based Expert Advisors. Import of functions from a DLL is used. The DLL is created using the Microsoft .NET platform and the C# language. The methods used in the article are also suitable for experts written in MQL4, with minor adjustments.
How to Copy Trading from MetaTrader 5 to MetaTrader 4
How to Copy Trading from MetaTrader 5 to MetaTrader 4

How to Copy Trading from MetaTrader 5 to MetaTrader 4

Is it possible to trade on a real MetaTrader 5 account today? How to organize such trading? The article contains the theory of these questions and the working codes used for copying trades from the MetaTrader 5 terminal to MetaTrader 4. The article will be useful both for the developers of Expert Advisors and for practicing traders.
Creating a custom news feed for MetaTrader 5
Creating a custom news feed for MetaTrader 5

Creating a custom news feed for MetaTrader 5

In this article we look at the possibility of creating a flexible news feed that offers more options in terms of the type of news and also its source. The article will show how a web API can be integrated with the MetaTrader 5 terminal.
MetaTrader 5: Publishing trading forecasts and live trading statements via e-mail on blogs, social networks and dedicated websites
MetaTrader 5: Publishing trading forecasts and live trading statements via e-mail on blogs, social networks and dedicated websites

MetaTrader 5: Publishing trading forecasts and live trading statements via e-mail on blogs, social networks and dedicated websites

This article aims to present ready-made solutions for publishing forecasts using MetaTrader 5. It covers a range of ideas: from using dedicated websites for publishing MetaTrader statements, through setting up one's own website with virtually no web programming experience needed and finally integration with a social network microblogging service that allows many readers to join and follow the forecasts. All solutions presented here are 100% free and possible to setup by anyone with a basic knowledge of e-mail and ftp services. There are no obstacles to use the same techniques for professional hosting and commercial trading forecast services.
Evaluation and selection of variables for machine learning models
Evaluation and selection of variables for machine learning models

Evaluation and selection of variables for machine learning models

This article focuses on specifics of choice, preconditioning and evaluation of the input variables (predictors) for use in machine learning models. New approaches and opportunities of deep predictor analysis and their influence on possible overfitting of models will be considered. The overall result of using models largely depends on the result of this stage. We will analyze two packages offering new and original approaches to the selection of predictors.
preview
OpenCL: From Naive Towards More Insightful Programming

OpenCL: From Naive Towards More Insightful Programming

This article focuses on some optimization capabilities that open up when at least some consideration is given to the underlying hardware on which the OpenCL kernel is executed. The figures obtained are far from being ceiling values but even they suggest that having the existing resources available here and now (OpenCL API as implemented by the developers of the terminal does not allow to control some parameters important for optimization - particularly, the work group size), the performance gain over the host program execution is very substantial.
LifeHack for traders: Blending ForEach with defines (#define)
LifeHack for traders: Blending ForEach with defines (#define)

LifeHack for traders: Blending ForEach with defines (#define)

The article is an intermediate step for those who still writes in MQL4 and has no desire to switch to MQL5. We continue to search for opportunities to write code in MQL4 style. This time, we will look into the macro substitution of the #define preprocessor.
Developing stock indicators featuring volume control through the example of the delta indicator
Developing stock indicators featuring volume control through the example of the delta indicator

Developing stock indicators featuring volume control through the example of the delta indicator

The article deals with the algorithm of developing stock indicators based on real volumes using the CopyTicks() and CopyTicksRange() functions. Some subtle aspects of developing such indicators, as well as their operation in real time and in the strategy tester are also described.
Developing graphical interfaces for Expert Advisors and indicators based on .Net Framework and C#
Developing graphical interfaces for Expert Advisors and indicators based on .Net Framework and C#

Developing graphical interfaces for Expert Advisors and indicators based on .Net Framework and C#

The article presents a simple and fast method of creating graphical windows using Visual Studio with subsequent integration into the Expert Advisor's MQL code. The article is meant for non-specialist audiences and does not require any knowledge of C# and .Net technology.