MQL4 and MQL5 Programming Articles

icon

Study the MQL5 language for programming trading strategies in numerous published articles mostly written by you - the community members. The articles are grouped into categories to help you quicker find answers to any questions related to programming: Integration, Tester, Trading Strategies, etc.

Follow our new publications and discuss them on the Forum!

Add a new article
latest | best
Interview with Evgeny Gnidko (ATC 2012)
Interview with Evgeny Gnidko (ATC 2012)

Interview with Evgeny Gnidko (ATC 2012)

The Expert Advisor of Evgeny Gnidko (FIFO) currently seems to be the most stable one at the Automated Trading Championship 2012. This trading robot entered TOP-10 at the third week remaining one of the leading Expert Advisors ever since.
Interview with Juan Pablo Alonso Escobar (ATC 2012)
Interview with Juan Pablo Alonso Escobar (ATC 2012)

Interview with Juan Pablo Alonso Escobar (ATC 2012)

"Everyone who is struggling with programming and who were not able to participate in this year's competition, know that it becomes a lot easier in time", said Juan Pablo Alonso Escobar (JPAlonso), the hero of today's interview.
MetaTrader 4 on Linux
MetaTrader 4 on Linux

MetaTrader 4 on Linux

In this article, we demonstrate an easy way to install MetaTrader 4 on popular Linux versions — Ubuntu and Debian. These systems are widely used on server hardware as well as on traders’ personal computers.
preview
How to become a Signals Provider for MetaTrader 4 and MetaTrader 5

How to become a Signals Provider for MetaTrader 4 and MetaTrader 5

Do you want to offer your trading signals and make profit? Register on MQL5.com website as a Seller, specify your trading account and offer traders a subscription to copy your trades.
How to Test a Trading Robot Before Buying
How to Test a Trading Robot Before Buying

How to Test a Trading Robot Before Buying

Buying a trading robot on MQL5 Market has a distinct benefit over all other similar options - an automated system offered can be thoroughly tested directly in the MetaTrader 5 terminal. Before buying, an Expert Advisor can and should be carefully run in all unfavorable modes in the built-in Strategy Tester to get a complete grasp of the system.
Interview with Dmitry Terentew (ATC 2012)
Interview with Dmitry Terentew (ATC 2012)

Interview with Dmitry Terentew (ATC 2012)

Is it really necessary to be a programmer to develop trading robots? Do we need to spend years monitoring price charts to be able to "feel" the market? All these issues have been discussed in our interview with Dmitry Terentew (SAFF), whose trading robot has been occupying the first page of the Championship from the very beginning.
Interview with Anton Nel (ATC 2012)
Interview with Anton Nel (ATC 2012)

Interview with Anton Nel (ATC 2012)

Today we talk to Anton Nel (ROMAN5) from South Africa, a professional developer of automated trading systems. Obviously, his Expert Advisor just could not go unnoticed. Breaking into the top ten from the very start of the Championship, it has been holding the first place for more than a week.
Interview with Matúš German (ATC 2012)
Interview with Matúš German (ATC 2012)

Interview with Matúš German (ATC 2012)

It's the second time Matúš German participates in the Automated Trading Championship. By the end of the fourth week of ATC 2012 his Expert Advisor has been holding its positions in the TOP-10 having about $30 000. Matúš is from Slovakia, from the little town Bardejov. Matúš is interested in trading for about 5 years and he develops Expert Advisors for 3 years already.
How Secure Is It to Buy MQL5 Market Products?
How Secure Is It to Buy MQL5 Market Products?

How Secure Is It to Buy MQL5 Market Products?

We have launched the service for selling MetaTrader 5 trading applications paying much attention to security issues. We have minimized all associated risks to allow you to concentrate on more important matters - searching for the most suitable trading robot!
Advantages of MQL5 Signals
Advantages of MQL5 Signals

Advantages of MQL5 Signals

Trading Signals service recently introduced in MetaTrader 5 allows traders to copy trading operations of any signals provider. Users can select any signal, subscribe to it and all deals will be copied at their accounts. Signals providers can set their subscription prices and receive a fixed monthly fee from their subscribers.
Interview with Egidijus Bockus (ATC 2012)
Interview with Egidijus Bockus (ATC 2012)

Interview with Egidijus Bockus (ATC 2012)

"I examined many indicators before realizing that they are not necessary for making money on Forex" - our present interviewee Egidijus Bockus (Egidijus) told us boldly. We have all reasons to take his words seriously, as his Expert Advisor occupies the third place with more than $32 000 beginning from the third week of the Automated Trading Championship 2012.
Interview with Alexander Prishchenko (ATC 2012)
Interview with Alexander Prishchenko (ATC 2012)

Interview with Alexander Prishchenko (ATC 2012)

What can be more complicated than a multicurrency trading robot? Surely, it is an automated strategy based on Elliott Wave Principle. Can we imagine something more complicated than that? Yes, we can. It is a multicurrency Expert Advisor using Elliott Waves on each currency pair! Alexander Prishchenko (Crucian) believes that even a newcomer can learn the rules.
How to Write a Good Description for a Market Product
How to Write a Good Description for a Market Product

How to Write a Good Description for a Market Product

MQL5 Market has many products for sale but some of their descriptions leave much to be desired. Many texts are obviously in need of improvement, as common traders are not able to comprehend them. This article will help you to put your product in a favorable light. Use our recommendations to write an eye-catching description that will easily show your customers what exactly you are selling.
Interview with Francisco García García (ATC 2012)
Interview with Francisco García García (ATC 2012)

Interview with Francisco García García (ATC 2012)

Today we interview Francisco García García (chuliweb) from Spain. A week ago his Expert Advisor reached the 8th place, but the unfortunate logic error in programming threw it from the first page of the Championship leaders. As confirmed by statistics, such an error is not uncommon for many participants.
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.
Statistical Carry Trade Strategy
Statistical Carry Trade Strategy

Statistical Carry Trade Strategy

An algorithm of statistical protection of open positive swap positions from unwanted price movements. This article features a variant of the carry trade protection strategy that allows to compensate for potential risk of the price movement in the direction opposite to that of the open position.
How to Subscribe to Trading Signals
How to Subscribe to Trading Signals

How to Subscribe to Trading Signals

The Signals service introduces social trading with MetaTrader 4 and MetaTrader 5. The Service is integrated into the trading platform, and allows anyone to easily copy trades of professional traders. Select any of the thousands of signal providers, subscribe in a few clicks and the provider's trades will be copied on your account.
Interview with Andrey Barinov (ATC 2012)
Interview with Andrey Barinov (ATC 2012)

Interview with Andrey Barinov (ATC 2012)

It was on Friday of the Championship's first week that the trading robot of Andrey Barinov (Wahoo) occupied the fifth place in TOP-10. Andrey is a newcomer in the Championship but he has already managed to execute more than 100 orders in Jobs and develop a dozen of products for Market. We have arranged an interview with him and learned that the development of a "simple multicurrency Expert Advisor" is not an easy but a fairly easy task.
Trading Signals in MetaTrader 5: A Better Alternative to PAMM Accounts!
Trading Signals in MetaTrader 5: A Better Alternative to PAMM Accounts!

Trading Signals in MetaTrader 5: A Better Alternative to PAMM Accounts!

We are pleased to announce that MetaTrader 5 now features Trading Signals, thus giving a powerful tool to investors and managers. While you are following the trades of a successful trader, the terminal will be automatically reproducing them in your account!
Interview with Rogério Figurelli (ATC 2012)
Interview with Rogério Figurelli (ATC 2012)

Interview with Rogério Figurelli (ATC 2012)

Today we are going to talk with Rogério Figurelli (figurelli), a regular participant from Brazil that has not missed any Automated Trading Championship since 2007. This year, he also began to sell his Championship's Expert Advisor in the Market along with his other products. Rogério believes that MetaTrader 5 platform certification on the largest Brazilian exchange BM&FBOVESPA will reveal new professional developers and traders, who do not yet know the full potential of robot investors.
Interview with Achmad Hidayat (ATC 2012)
Interview with Achmad Hidayat (ATC 2012)

Interview with Achmad Hidayat (ATC 2012)

Throughout the entire duration of the Automated Trading Championship 2012, we will be providing live coverage of the events - hot reports and interviews every week. This report spotlights Achmad Hidayat (achidayat), the participant from Indonesia. On the first day of the Championship his Expert Advisor secured its position in the third ten, which is a good start. Achmad has sparked our interest with his active participation in the MQL5 Market. He has already published over 20 products thus far.
Quick Start: Short Guide for Beginners
Quick Start: Short Guide for Beginners

Quick Start: Short Guide for Beginners

Hello dear reader! In this article, I will try to explain and show you how you can easily and quickly get the hang of the principles of creating Expert Advisors, working with indicators, etc. It is beginner-oriented and will not feature any difficult or abstruse examples.
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.
Exploring Trading Strategy Classes of the Standard Library - Customizing Strategies
Exploring Trading Strategy Classes of the Standard Library - Customizing Strategies

Exploring Trading Strategy Classes of the Standard Library - Customizing Strategies

In this article we are going to show how to explore the Standard Library of Trading Strategy Classes and how to add Custom Strategies and Filters/Signals using the Patterns-and-Models logic of the MQL5 Wizard. In the end you will be able easily add your own strategies using MetaTrader 5 standard indicators, and MQL5 Wizard will create a clean and powerful code and fully functional Expert Advisor.
Fundamentals of Statistics
Fundamentals of Statistics

Fundamentals of Statistics

Every trader works using certain statistical calculations, even if being a supporter of fundamental analysis. This article walks you through the fundamentals of statistics, its basic elements and shows the importance of statistics in decision making.
How to purchase a trading robot from the MetaTrader Market and to install it?
How to purchase a trading robot from the MetaTrader Market and to install it?

How to purchase a trading robot from the MetaTrader Market and to install it?

A product from the MetaTrader Market can be purchased on the MQL5.com website or straight from the MetaTrader 4 and MetaTrader 5 trading platforms. Choose a desired product that suits your trading style, pay for it using your preferred payment method, and activate the product.
MetaQuotes ID in MetaTrader Mobile Terminal
MetaQuotes ID in MetaTrader Mobile Terminal

MetaQuotes ID in MetaTrader Mobile Terminal

Android and iOS powered devices offer us many features we do not even know about. One of these features is push notifications allowing us to receive personal messages, regardless of our phone number or mobile network operator. MetaTrader mobile terminal already can receive such messages right from your trading robot. You should only know MetaQuotes ID of your device. More than 9 000 000 mobile terminals have already received it.
Trade Operations in MQL5 - It's Easy
Trade Operations in MQL5 - It's Easy

Trade Operations in MQL5 - It's Easy

Almost all traders come to market to make money but some traders also enjoy the process itself. However, it is not only manual trading that can provide you with an exciting experience. Automated trading systems development can also be quite absorbing. Creating a trading robot can be as interesting as reading a good mystery novel.
Interview with Irina Korobeinikova (irishka.rf)
Interview with Irina Korobeinikova (irishka.rf)

Interview with Irina Korobeinikova (irishka.rf)

Having a female member on the MQL5.community is rare. This interview was inspired by a one of a kind case. Irina Korobeinikova (irishka.rf) is a fifteen-year-old programmer from Izhevsk. She is currently the only girl who actively participates in the "Jobs" service and is featured on the Top Developers list.
Application of the Eigen-Coordinates Method to Structural Analysis of Nonextensive Statistical Distributions
Application of the Eigen-Coordinates Method to Structural Analysis of Nonextensive Statistical Distributions

Application of the Eigen-Coordinates Method to Structural Analysis of Nonextensive Statistical Distributions

The major problem of applied statistics is the problem of accepting statistical hypotheses. It was long considered impossible to be solved. The situation has changed with the emergence of the eigen-coordinates method. It is a fine and powerful tool for a structural study of a signal allowing to see more than what is possible using methods of modern applied statistics. The article focuses on practical use of this method and sets forth programs in MQL5. It also deals with the problem of function identification using as an example the distribution introduced by Hilhorst and Schehr.
preview
Fast Dive into MQL5

Fast Dive into MQL5

You have decided to study MQL5 trading strategies' programming language, but you know nothing about it? We have tried to examine MQL5 and MetaTrader 5 terminal from the newcomers' point of view and have written this short introductory article. In this article, you can find a brief idea of the possibilities of the language, as well as some tips on working with MetaEditor 5 and the terminal.
An Insight Into Accumulation/Distribution And Where It Can Get You
An Insight Into Accumulation/Distribution And Where It Can Get You

An Insight Into Accumulation/Distribution And Where It Can Get You

The Accumulation/Distribution (A/D) Indicator has one interesting feature - a breakout of the trend line plotted in this indicator chart suggests, with a certain degree of probability, a forthcoming breakout of the trend line in the price chart. This article will be useful and interesting for those who are new to programming in MQL4. Having this in view, I have tried to present the information in an easy to grasp manner and use the simplest code structures.
preview
How to Make a Trading Robot in No Time

How to Make a Trading Robot in No Time

Trading on financial markets involves many risks including the most critical one - the risk of making a wrong trading decision. The dream of every trader is to find a trading robot, which is always in good shape and not subject to human weaknesses - fear, greed and impatience.
Introduction to the Empirical Mode Decomposition Method
Introduction to the Empirical Mode Decomposition Method

Introduction to the Empirical Mode Decomposition Method

This article serves to familiarize the reader with the empirical mode decomposition (EMD) method. It is the fundamental part of the Hilbert–Huang transform and is intended for analyzing data from nonstationary and nonlinear processes. This article also features a possible software implementation of this method along with a brief consideration of its peculiarities and gives some simple examples of its use.
Money-Making Algorithms Employing Trailing Stop
Money-Making Algorithms Employing Trailing Stop

Money-Making Algorithms Employing Trailing Stop

This article's objective is to study profitability of algorithms with different entries into trades and exits using trailing stop. Entry types to be used are random entry and reverse entry. Stop orders to be used are trailing stop and trailing take. The article demonstrates money-making algorithms with a profitability of about 30% per annum.
The Most Active MQL5.community Members Have Been Awarded iPhones!
The Most Active MQL5.community Members Have Been Awarded iPhones!

The Most Active MQL5.community Members Have Been Awarded iPhones!

After we decided to reward the most outstanding MQL5.com participants, we have selected the key criteria to determine each participant's contribution to the Community development. As a result, we have the following champions who published the greatest amount of articles on the website - investeo (11 articles) and victorg (10 articles), and who submitted their programs to Code Base – GODZILLA (340 programs), Integer (61 programs) and abolk (21 programs).
Why Is MQL5 Market the Best Place for Selling Trading Strategies and Technical Indicators
Why Is MQL5 Market the Best Place for Selling Trading Strategies and Technical Indicators

Why Is MQL5 Market the Best Place for Selling Trading Strategies and Technical Indicators

MQL5.community Market provides Expert Advisors developers with the already formed market consisting of thousands of potential customers. This is the best place for selling trading robots and technical indicators!
MetaTrader 4 on Mac OS
MetaTrader 4 on Mac OS

MetaTrader 4 on Mac OS

Apple products have become very popular. MetaQuotes Software Corp. attentively follows the progress of the IT industry and has already released the special mobile applications for iOS-based devices - MetaTrader 4 for iPhone and MetaTrader 5 for iPhone.There are many topics on the MQL4.community forum, where people are seeking a solution for running MetaTrader 4 under the Mac OS operating system. In this article, you will find out how to work in MetaTrader 4 via the Apple's popular operating system.
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.
Limitless Opportunities with MetaTrader 5 and MQL5
Limitless Opportunities with MetaTrader 5 and MQL5

Limitless Opportunities with MetaTrader 5 and MQL5

In this article, I would like to give an example of what a trader's program can be like as well as what results can be achieved in 9 months, having started to learn MQL5 from scratch. This example will also show how multi-functional and informative such a program can be for a trader while taking minimum space on the price chart. And we will be able to see just how colorful, bright and intuitively clear to the user trade information panels can get. As well as many other features...