MQL4 Programming Articles


Here you can find articles on MQL4 - programming language of trading strategies. Most of them are written by traders and active members of For more convenience, all articles are grouped into several categories - Experts, Indicators, Trading Systems, etc.

Watch out for new articles and discuss them on the Forum!

Add a new article
latest | best

How To Implement Your Own Optimization Criteria

In this article an example of optimization by profit/drawdown criterion with results returned into a file is developed for a standard Expert Advisor - Moving Average

Technical Analysis: Make the Impossible Possible!

The article answers the question: Why can the impossible become possible where much suggests otherwise? Technical analysis reasoning

Breakpoints in Tester: It's Possible!

The article deals with breakpoint emulation when passed through Tester, debug information being displayed

Mathematics in Trading: How to Estimate Trade Results

We all are aware of that "No profit obtained in the past will guarantee any success in future". However, it is still very actual to be able to estimate trading systems. This article deals with some

What is Martingale and Is It Reasonable to Use It?

This article contains a detailed description of the Martingale system, as well as precise mathematical calculations, necessary for answering the question: "Is it reasonable to use Martingale?"

Construction of Fractal Lines

The article describes construction of fractal lines of various types using trend lines and fractals

MQL4 Language for Newbies. Technical Indicators and Built-In Functions

This is the third article from the series "MQL4 Language for Newbies". Now we will learn to use built-in functions and functions for working with technical indicators. The latter ones will be

Creation of an Automated Trading System

You must admit that it sounds alluringly - you become a fortunate possessor of a program that can develop for you a profitable automated trading system (ATC) within a few minutes. All you need is to

How to Cut an EA Code for an Easier Life and Fewer Errors

A simple concept described in the article allows those developing automated trading systems in MQL4 to simplify existing trading systems, as well as reduce time needed for development of new systems

Practical Use of the Virtual Private Server (VPS) for Autotrading

Autotrading using VPS. This article is intended exceptionally for autotraders and autotrading supporters

Price Forecasting Using Neural Networks

Many traders speak about neural networks, but what they are and what they really can is known to few people. This article sheds some light on the world of artificial intelligence. It describes, how to

ZUP - Universal ZigZag with Pesavento Patterns. Part 2

ZUP - Universal ZigZag with Pesavento Patterns. Part 2 - Description of Embedded Tools

Strings: Table of ASCII Symbols and Its Use

In this article we will analyze the table of ASCII symbols and the ways it can be used. We will also deal with some new functions, the principle of operation of which is based on the peculiarities of

Testing Visualization: Account State Charts

Enjoy the process of testing with charts, displaying the balance - now all the necessary information is always in view

Non-standard Automated Trading

Successful and comfortable trading using MT4 platform without detailed market analysis - is it possible? Can such trading be implemented in practice? I suppose, yes. Especially in terms of the

Tester in the Terminal MetaTrader 4: It Should Be Known

The elaborate interface of the terminal MetaTrader 4 is a forefront, but beside this the terminal includes a deep-laid tester of strategies. And while the worth of MetaTrader 4 as a trading terminal

Interaction between MetaTrader 4 and Matlab via CSV Files

Step-by-step instructions of how to organize data arrays exchange between MetaTrader 4 and Matlab via CSV files

Sending Trading Signals in a Universal Expert Advisor

The article describes different ways of sending trading signals from a signal program unit of a universal Expert Advisor into the positions and orders controlling unit. It dwells on serial and

Theoretical Basis of Building Cluster Indicators for FOREX

Cluster indicators are sets of indicators that divide currency pairs into separate currencies. Indicators allow to trace the relative currency fluctuation, determine the potential of formating new

Tricolor Indicators and Some Opportunities for Maximal Simplification of Writing Indicators

In this article the author dwells on some means of increasing indicators' informational value for visual trading. The author analyzes the realization of tricolor indicators, indicators, for building

Forex Trading ABC

Working on financial markets represents, first of all, trade operations. We all, starting from the very childhood, have an intuitive idea of what is to buy and to sell. But Forex trading is still

Sending Trade Signal Via RSS Feed

This is my idea how to send your trade signal as RSS FEEDS , a famous way to communicate with your community's members right now

The Basic of Coding A Hedge Expert Advisor

An example of hedge Expert Advisor is just presented in this article. The author will choose its very own favorite hedge pair that is EURJPY & GBPJPY. It always moves the same way, easier to set the

ZUP - Universal ZigZag with Pesavento Patterns. Part 1

The article gives a short description of ideas underlying indicator ZUP - Universal ZigZag with Pesavento Patterns. The article also describes indicators of ZigZag embedded in ZUP

MQL4 Language for Newbies. Difficult Questions in Simple Phrases.

This is the second article from the series "MQL4 Language for Newbies". Now we will examine more complex and advanced constructions of the language, learn new options and see, how they can be applied

Running MetaTrader 4 Client Terminal on Linux-Desktop

Description of a step-by-step Linux-desktop setup using a non-emulator wine for running MetaTrader 4 Client Terminal on it

MQL4 Language for Newbies. Introduction

This sequence of articles is intended for traders, who know nothing about programming, but have a desire to learn MQL4 language as quick as possible with minimal time and effort inputs. If you are

How to Develop a Reliable and Safe Trade Robot in MQL 4

The article deals with the most common errors that occur in developing and using of an Expert Advisor. An exemplary safe automated trading system is described, as well

Modelling Requotes in Tester and Expert Advisor Stability Analysis

Requote is a scourge for many Expert Advisors, especially for those that have rather sensitive conditions of entering/exiting a trade. In the article, a way to check up the EA for the requotes

Ten "Errors" of a Newcomer in Trading?

The article substantiates approach to building a trading system as a sequence of opening and closing the interrelated orders regarding the existing conditions - prices and the current values of each

Alternative Log File with the Use of HTML and CSS

In this article we will describe the process of writing a simple but a very powerful library for making the html files, will learn to adjust their displaying and will see how they can be easily

Simultaneous Displaying of the Signals of Several Indicators from the Four Timeframes

While manual trading you have to keep an eye on the values of several indicators. It is a little bit different from mechanical trading. If you have two or three indicators and you have chosen a one

Sound Alerts in Indicators

How to create "voice" indicators for daily usage

Displaying of Support/Resistance Levels

The article deals with detecting and indicating Support/Resistance Levels in the MetaTrader 4 program. The convenient and universal indicator is based on a simple algorithm. The article also tackles

A Method of Drawing the Support/Resistance Levels

This article describes the process of creating a simple script for detecting the support/resistance levels. It is written for beginners, so you can find the detailed explanation of every stage of the

Genetic Algorithms vs. Simple Search in the MetaTrader 4 Optimizer

The article compares the time and results of Expert Advisors' optimization using genetic algorithms and those obtained by simple search

Pivot Points Helping to Define Market Trends

Pivot point is a line in the price chart that shows the further trend of a currency pair. If the price is above this line, it tends to grow. If the price is below this line, accordingly, it tends to

Expert System 'Commentator'. Practical Use of Embedded Indicators in an MQL4 Program

The article describes the use of technical indicators in programming on MQL4

Events in МetaТrader 4

The article deals with programmed tracking of events in the МetaТrader 4 Client Terminal, such as opening/closing/modifying orders, and is targeted at a user who has basic skills in working with the

Synchronization of Expert Advisors, Scripts and Indicators

The article considers the necessity and general principles of developing a bundled program that would contain both an Expert Advisor, a script and an indicator