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!

latest | best

How to conduct a qualitative analysis of trading signals and select the best of them

The article deals with evaluating the performance of Signals Providers. We offer several additional parameters highlighting signal trading results from a slightly different angle than in traditional

Angles in Trading. Further Study Required

In this article, we discuss the method of trading analysis by measuring angles in the MetaTrader 4 terminal. The article provides a general plan of using angles for trend movement analysis, as well as

ZUP - universal ZigZag with Pesavento patterns. Graphical interface

Over the ten years since the release of the first version of the ZUP platform, it has undergone through multiple changes and improvements. As a result, now we have a unique graphical add-on for

How to build and test a Binary Options strategy with the MetaTrader 4 Strategy Tester

Tutorial to build a Binary Options strategy an test it in Strategy-Tester of MetaTrader 4 with Binary-Options-Strategy-Tester utility from marketplace

Working with currency baskets in the Forex market

The article describes how currency pairs can be divided into groups (baskets), as well as how to obtain data about their status (for example, overbought and oversold) using certain indicators and how

Portfolio trading in MetaTrader 4

The article reveals the portfolio trading principles and their application to Forex market. A few simple mathematical portfolio arrangement models are considered. The article contains examples of

False trigger protection for Trading Robot

Profitability of trading systems is defined not only by logic and precision of analyzing the financial instrument dynamics, but also by the quality of the performance algorithm of this logic. False

Using text files for storing input parameters of Expert Advisors, indicators and scripts

The article describes the application of text files for storing dynamic objects, arrays and other variables used as properties of Expert Advisors, indicators and scripts. The files serve as a

How to create an indicator of non-standard charts for MetaTrader Market

Through offline charts, programming in MQL4, and reasonable willingness, you can get a variety of chart types: "Point & Figure", "Renko", "Kagi", "Range bars", equivolume charts, etc. In this article

Evaluating the effectiveness of trading systems by analyzing their components

This article explores the effectiveness of complex trading systems by analyzing the efficiency of its individual components. Any analysis, whether it is graphic, based on indicators, or any other, is

Applying fuzzy logic in trading by means of MQL4

The article deals with examples of applying fuzzy set theory in trading by means of MQL4. The use of FuzzyNet library for MQL4 in the development of an indicator and an Expert Advisor is described as

Deep neural network with Stacked RBM. Self-training, self-control

This article is a continuation of previous articles on deep neural network and predictor selection. Here we will cover features of a neural network initiated by Stacked RBM, and its implementation in

Enhancing the StrategyTester to Optimize Indicators Solely on the Example of Flat and Trend Markets

It is essential to detect whether a market is flat or not for many strategies. Using the well known ADX we demonstrate how we can use the Strategy Tester not only to optimize this indicator for our

Thomas DeMark's contribution to technical analysis

The article details TD points and TD lines discovered by Thomas DeMark. Their practical implementation is revealed. In addition to that, a process of writing three indicators and two Expert Advisors

Fuzzy logic to create manual trading strategies

This article suggests the ways of improving manual trading strategy by applying fuzzy set theory. As an example we have provided a step-by-step description of the strategy search and the selection of

Price Action. Automating the Engulfing Pattern Trading Strategy

This article describes a process of creating an Expert Advisor for MetaTrader 4 based on the Engulfing pattern, as well as the pattern recognition principle, rules of setting pending orders and stop

How to Develop a Profitable Trading Strategy

This article provides an answer to the question: "Is it possible to formulate an automated trading strategy based on history data with neural networks?"

Price Action. Automating the Inside Bar Trading Strategy

The article describes the development of a MetaTrader 4 Expert Advisor based on the Inside Bar strategy, including Inside Bar detection principles, as well as pending and stop order setting rules

Managing the MetaTrader Terminal via DLL

The article deals with managing MetaTrader user interface elements via an auxiliary DLL library using the example of changing push notification delivery settings. The library source code and the

Statistical Verification of the Labouchere Money Management System

In this article, we test the statistical properties of the Labouchere money management system. It is considered to be a less aggressive kind of Martingale, since bets are not doubled, but are raised

Identifying Trade Setups by Support, Resistance and Price Action

This article shows how price action and the monitoring of support and resistance levels can be used for well-timed market entry. It discusses a trading system that effectively combines the two for the

Trading Ideas Based on Prices Direction and Movement Speed

The article provides a review of an idea based on the analysis of prices' movement direction and their speed. We have performed its formalization in the MQL4 language presented as an expert advisor to

How we developed the MetaTrader Signals service and Social Trading

We continue to enhance the Signals service, improve the mechanisms, add new functions and fix flaws. The MetaTrader Signals Service of 2012 and the current MetaTrader Signals Service are like two

Why Is It Important to Update MetaTrader 4 to the Latest Build by August 1?

From August 1, 2014, MetaTrader 4 desktop terminals older than build 600 will no longer be supported. However, many traders still work with outdated versions and are unaware of the updated platform's

Common Errors in MQL4 Programs and How to Avoid Them

To avoid critical completion of programs, the previous version compiler handled many errors in the runtime environment. For example, division by zero or array out of range are critical errors and

Upgrade to MetaTrader 4 Build 600 and Higher

The new version of the MetaTrader 4 terminal features the updated structure of user data storage. In earlier versions all programs, templates, profiles etc. were stored directly in terminal

Data Structure in MetaTrader 4 Build 600 and Higher

MetaTarder 4 build 600 features the new structure and location of the client terminal files. Now, MQL4 applications are placed in separate directories according to the program type (Expert Advisors

Offline Charts in the New MQL4

Updated MQL4 has the new format for storing historical data and provides the appropriate MqlRates structure for convenient storage of Time, Open, Low, High, Close and Volume values. For many years

Testing and Optimization of Expert Advisors

The article provides a detailed description of the process of testing and optimizing Expert Advisors in the MetaTrader 4 Strategy Tester. The importance of such information and the need for this

Lite_EXPERT2.mqh: Expert Advisor Implementation Examples

In this article, the author continues to familiarize the readers with the Lite_EXPERT2.mqh functions using real Expert Advisor implementation examples. The article deals with the idea of using

Advanced Analysis of a Trading Account

The article deals with the automatic system for analyzing any trading account in MetaTrader 4 terminal. Technical aspects of a generated report and interpretation of the obtained results are

Visual Optimization of Indicator and Signal Profitability

This article is a continuation and development of my previous article "Visual Testing of Profitability of Indicators and Alerts". Having added some interactivity to the parameter changing process and

Lite_EXPERT2.mqh: Functional Kit for Developers of Expert Advisors

This article continues the series of articles "Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization". It familiarizes the readers with a more universal function

EA Status SMS Notifications

Developing a system of SMS notifications that informs you of the status of your EA so that you are always aware of any critical situation, wherever you may be

Expert Advisor for Trading in the Channel

The Expert Advisor plots the channel lines. The upper and lower channel lines act as support and resistance levels. The Expert Advisor marks datum points, provides sound notification every time the

Simple Methods of Forecasting Directions of the Japanese Candlesticks

Knowing the direction of the price movement is sufficient for getting positive results from trading operations. Some information on the possible direction of the price can be obtained from the

How Reliable is Night Trading?

The article covers the peculiarities of night flat trading on cross currency pairs. It explains where you can expect profits and why great losses are not unlikely. The article also features an example

Money Management Revisited

The article deals with some issues arising when traders apply various money management systems to Forex trading. Experimental data obtained from performing trading deals using different money

Alert and Comment for External Indicators (Part Two)

Since I published the article "Alert and Comment for External Indicators", I have been receiving requests and questions regarding the possibility of developing an external informer operating based on

Alert and Comment for External Indicators. Multi-Currency Analysis Through External Scanning

Alert for multi-currency and multiple time frame analysis of external indicators. The article deals with a method of getting event information in respect of events in external indicators, without