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

Poll: Traders’ Estimate of the Mobile Terminal

Unfortunately, there are no clear projections available at this moment about the future of the mobile trading. However, there are a lot of speculations surrounding this matter. In our attempt to

MQL4 as a Trader's Tool, or The Advanced Technical Analysis

Trading is, first of all, a calculus of probabilities. The proverb about idleness being an engine for progress reveals us the reason why all those indicators and trading systems have been developed

Effective Averaging Algorithms with Minimal Lag: Use in Indicators

The article describes custom averaging functions of higher quality developed by the author: JJMASeries(), JurXSeries(), JLiteSeries(), ParMASeries(), LRMASeries(), T3Series(). The article also deals

What Is a Martingale?

A short description of various illusions that come up when people trade using martingale betting strategies or misuse spiking and the like approaches

Testing Visualization: Manual Trading

Testing manual strategies on history. Check how your trading algorithm works turning a deaf ear to programming niceties

Testing Visualization: Functionality Enhancement

The article describes software that can make strategy testing highly similar to the real trading

Testing Visualization: Trade History

The article describes the possibilities of convenient viewing the trade history when visualizing tests. Starting from build 196, MetaTrader 4 Client Terminal offers testing visualization function. It

Beginners' Mistakes when Working with MetaTrader 4 Client Terminal

Err is human. Everybody makes mistakes: more or less frequently, through ignorance or inadvertently. You ask and we answer your questions about: terminal time, test results, Print in journal, symbols

Graphic Expert Advisor: AutoGraf

The article shows the workability of graphics in creation of a convenient interface to manage trading

Trading Tactics on Forex

The article will help a beginning trader to develop trading tactics on FOREX

Secrets of MetaTrader 4 Client Terminal: File Library in MetaEditor

When creating custom programs, code editor is of great importance. The more functions are available in the editor, the faster and more convenient is creation of the program. Many programs are created

Orders Management - It's Simple

The article deals with various ways of how to control open positions and pending orders. It is devoted to simplifying of writing Expert Advisors

Trading Strategies

All categories classifying trading strategies are fully arbitrary. The classification below is to emphasize the basic differences between possible approaches to trading

Ten Basic Errors of a Newcomer in Trading

There are ten basic errors of a newcomer intrading: trading at market opening, undue hurry in taking profit, adding of lots in a losing position, closing positions starting with the best one, revenge

Multiple Null Bar Re-Count in Some Indicators

The article is concerned with the problem of re-counting of the indicator value in the MetaTrader 4 Client Terminal when the null bar changes. It outlines general idea of how to add to the indicator

Secrets of the MetaTrader 4 Client Terminal: Indicators

Are you going to write your own indicator? Perhaps you will find that what you need among indicators already embedded in the client terminal. So why to reinvent the wheel? A summary table of

Testing of Expert Advisors in the MetaTrader 4 Client Terminal: An Outward Glance

What happens after you have clicked on the "Start" button? The article answers this and many other questions

Secrets of MetaTrader 4 Client Terminal: Alerting System

How to be aware of what happens in the terminal and on your account without permanent looking at the monitor. System events; custom events; wave and executable files; electronic messages; setting up

Secrets of MetaTrader 4 Client Terminal

21 way to ease the life: Latent features in MetaTrader 4 Client Terminal. Full screen; hot keys; Fast Navigation bar; minimizing windows; favorites; traffic reduction; disabling of news; symbol sets;

My First "Grail"

Examined are the most frequent mistakes that lead the first-time programmers to creation of a "super-moneymaking" (when tested) trading systems. Exemplary experts that show fantastic results in

Considering Orders in a Large Program

General principles of considering orders in a large and complex program are discussed

A Pause between Trades

The article deals with the problem of how to arrange pauses between trade operations when a number of experts work on one МТ 4 Client Terminal. It is intended for users who have basic skills in both

MagicNumber: "Magic" Identifier of the Order

The article deals with the problem of conflict-free trading of several experts on the same МТ 4 Client Terminal. It "teaches" the expert to manage only "its own" orders without modifying or closing

How to Use Crashlogs to Debug Your Own DLLs

25 to 30% of all crashlogs received from users appear due to errors occurring when functions imported from custom dlls are executed

Working with Files. An Example of Important Market Events Visualization

The article deals with the outlook of using MQL4 for more productive work at FOREX markets

Error 146 ("Trade context busy") and How to Deal with It

The article deals with conflict-free trading of several experts on one МТ 4 Client Terminal. It will be useful for those who have basic command of working with the terminal and programming in MQL 4

Information Storage and View

The article deals with convenient and efficient methods of information storage and viewing. Alternatives to the terminal standard log file and the Comment() function are considered here

Free-of-Holes Charts

The article deals with realization of charts without skipped bars

One-Minute Data Modelling Quality Rating

One-Minute Data Modelling Quality Rating

Genetic Algorithms: Mathematics

Genetic (evolutionary) algorithms are used for optimization purposes. An example of such purpose can be neuronet learning, i.e., selection of such weight values that allow reaching the minimum error

How to Evaluate the Expert Testing Results

The article gives formulas and the calculation order for data shown in the Tester report

Requirements Applicable to Articles Offered for Publishing at

Requirements Applicable to Articles Offered for Publishing at

Expert Advisor Sample

The principles of MQL4-programs development are shown on sample of creating a simple Expert Advisor system based on the standard MACD indicator

What the Numbers in the Expert Testing Report Mean

Article explains how to read testing reports and to interpret the obtained results properly

Testing Features and Limits in MetaTrader 4

This article allows to find out more about features and limits of Strategy Tester in MetaTrader 4

Strategy Tester: Modes of Modeling during Testing

Many programs of technical analysis allow to test trading strategies on history data. In the most cases, the testing is conducted on already completed data without any attempts to model the trends

Features of Custom Indicators Creation

Creation of Custom Indicators in the MetaTrader trading system has a number of features

Features of Experts Advisors

Creation of expert advisors in the MetaTrader trading system has a number of features