MQL4 Programming Articles

icon

Here you can find articles on MQL4 - programming language of trading strategies. Most of them are written by traders and active members of MQL5.community. 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
Secrets of MetaTrader 4 Client Terminal: File Library in MetaEditor
Secrets of MetaTrader 4 Client Terminal: File Library in MetaEditor

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 on basis of an already existing code. Do you use an indicator or a script that does not fully suit your purposes? Download the code of this program from our website and customize it for yourselves.
A Trader's Assistant Based on Extended MACD Analysis
A Trader's Assistant Based on Extended MACD Analysis

A Trader's Assistant Based on Extended MACD Analysis

Script 'Trader's Assistant' helps you to make a decision on opening positions, based on the extended analysis of the MACD status for the last three bars in the real-time trading on any timeframe. It can also be used for back testing.
Tricolor Indicators and Some Opportunities for Maximal Simplification of Writing Indicators
Tricolor Indicators and Some Opportunities for Maximal Simplification of Writing Indicators

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 which data from other timeframes is used, and continues to dwell on the library of indicators, described in the article "Effective Averaging Algorithms with Minimal Lag: Use in Indicators"
Requirements Applicable to Articles Offered for Publishing at MQL4.com
Requirements Applicable to Articles Offered for Publishing at MQL4.com

Requirements Applicable to Articles Offered for Publishing at MQL4.com

Requirements Applicable to Articles Offered for Publishing at MQL4.com
Considering Orders in a Large Program
Considering Orders in a Large Program

Considering Orders in a Large Program

General principles of considering orders in a large and complex program are discussed.
Two-Stage Modification of Opened Positions
Two-Stage Modification of Opened Positions

Two-Stage Modification of Opened Positions

The two-stage approach allows you to avoid the unnecessary closing and re-opening of positions in situations close to the trend and in cases of possible occurrence of divirgence.
How to Cut an EA Code for an Easier Life and Fewer Errors
How to Cut an EA Code for an Easier Life and Fewer Errors

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 due to shorter codes.
Market Diagnostics by Pulse
Market Diagnostics by Pulse

Market Diagnostics by Pulse

In the article, an attempt is made to visualize the intensity of specific markets and of their time segments, to detect their regularities and behavior patterns.
Creation of an Automated Trading System
Creation of an Automated Trading System

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 enter desirable inputs and press Enter. And - here you are, take your ATC tested and having positive expected payoff. Where thousands of people spend thousands of hours on developing that very unique ATC, which will "wine and dine", these statements soundб to put it mildly, very hollow. On the one hand, this really looks a little larger than life... However, to my mind, this problem can be solved.
Testing Visualization: Account State Charts
Testing Visualization: Account State Charts

Testing Visualization: Account State Charts

Enjoy the process of testing with charts, displaying the balance - now all the necessary information is always in view!
Ten Basic Errors of a Newcomer in Trading
Ten Basic Errors of a Newcomer in 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, the most preferable positions, trading by the principle of 'bought for ever', closing of a profitable strategic position on the first day, closing of a position when alerted to open an opposite position, doubts.
Betting Modeling as Means of Developing "Market Intuition"
Betting Modeling as Means of Developing "Market Intuition"

Betting Modeling as Means of Developing "Market Intuition"

The article dwells on the notion of "market intuition" and ways of developing it. The method described in the article is based on the modeling of financial betting in the form of a simple game.
How to Use Crashlogs to Debug Your Own DLLs
How to Use Crashlogs to Debug Your Own DLLs

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.
Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization (Part III)
Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization (Part III)

Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization (Part III)

In this article the author continues to analyze implementation algorithms of simplest trading systems and introduces backtesting automation. The article will be useful for beginning traders and EA writers.
Automated Choice of Brokerage Company for an Efficient Operation of Expert Advisors
Automated Choice of Brokerage Company for an Efficient Operation of Expert Advisors

Automated Choice of Brokerage Company for an Efficient Operation of Expert Advisors

It is not a secret that for an efficient operation of Expert Advisors we need to find a suitable brokerage company. This article describes a system approach to this search. You will get acquainted with the process of creating a program with dll for working with different terminals.
Filtering by History
Filtering by History

Filtering by History

The article describes the usage of virtual trading as an integral part of trade opening filter.
Grouped File Operations
Grouped File Operations

Grouped File Operations

It is sometimes necessary to perform identical operations with a group of files. If you have a list of files included into a group, then it is no problem. However, if you need to make this list yourself, then a question arises: "How can I do this?" The article proposes doing this using functions FindFirstFile() and FindNextFile() included in kernel32.dll.
Idleness is the Stimulus to Progress. Semiautomatic Marking a Template
Idleness is the Stimulus to Progress. Semiautomatic Marking a Template

Idleness is the Stimulus to Progress. Semiautomatic Marking a Template

Among the dozens of examples of how to work with charts, there is a method of manual marking a template. Trend lines, channels, support/resistance levels, etc. are imposed in a chart. Surely, there are some special programs for this kind of work. Everyone decides on his/her own which method to use. In this article, I offer you for your consideration the methods of manual marking with subsequent automating some elements of the repeated routine actions.
Simultaneous Displaying of the Signals of Several Indicators from the Four Timeframes
Simultaneous Displaying of the Signals of Several Indicators from the Four Timeframes

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 timeframe for trading, it is not a complicated task. But what will you do if you have five or six indicators and your trading strategy requires considering the signals on the several timeframes?
Terminal Service Client. How to Make Pocket PC a Big Brother's Friend
Terminal Service Client. How to Make Pocket PC a Big Brother's Friend

Terminal Service Client. How to Make Pocket PC a Big Brother's Friend

The article describes the way of connecting to the remote PC with installed MT4 Client Terminal via a PDA.
Ten "Errors" of a Newcomer in Trading?
Ten "Errors" of a Newcomer in Trading?

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 order's profit/loss, not only and not so much the conventional "alerts". We are giving an exemplary realization of such an elementary trading system.
Technical Analysis: Make the Impossible Possible!
Technical Analysis: Make the Impossible Possible!

Technical Analysis: Make the Impossible Possible!

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

Trading Using Linux

The article describes how to use indicators to watch the situation on financial markets online.
Modelling Requotes in Tester and Expert Advisor Stability Analysis
Modelling Requotes in Tester and Expert Advisor Stability Analysis

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 stability is offered.
All about Automated Trading Championship: Statistical Reports
All about Automated Trading Championship: Statistical Reports

All about Automated Trading Championship: Statistical Reports

Creating a profitable and stable trading system is always related to statistical data processing. In this article, we pout together statistical reports of the Automated Trading Championships 2006-2007. It may well be that the information they provide will help you find new trading ideas or correct the existing ones. Analyze the data and save your time.
View of Technical Analysis in the Context of Automatic Control Systems (ACS), or "Reverse View"
View of Technical Analysis in the Context of Automatic Control Systems (ACS), or "Reverse View"

View of Technical Analysis in the Context of Automatic Control Systems (ACS), or "Reverse View"

The article demonstrates an alternative view of technical analysis, which is based on the principles of both the modern automatic control theory and technical analysis itself. It is an introductory article representing the theory with some practical applications of it.
Superposition and Interference of Financial Securities
Superposition and Interference of Financial Securities

Superposition and Interference of Financial Securities

The more factors influence the behavior of a currency pair, the more difficult it is to evaluate its behavior and make up future forecasts. Therefore, if we managed to extract components of a currency pair, values of a national currency that change with the time, we could considerably delimit the freedom of national currency movement as compared to the currency pair with this currency, as well as the number of factors influencing its behavior. As a result we would increase the accuracy of its behavior estimation and future forecasting. How can we do that?
Easy Way to Publish a Video at MQL4.Community
Easy Way to Publish a Video at MQL4.Community

Easy Way to Publish a Video at MQL4.Community

It is usually easier to show, than to explain. We offer a simple and free way to create a video clip using CamStudio for publishing it in MQL.community forums.
Idleness is the Stimulus to Progress, or How to Work with Graphics Interacively
Idleness is the Stimulus to Progress, or How to Work with Graphics Interacively

Idleness is the Stimulus to Progress, or How to Work with Graphics Interacively

An indicator for interactive working with trend lines, Fibo levels, icons manually imposed on a chart. It allows you to draw the colored zones of Fibo levels, shows the moments of the price crossing the trend line, manages the "Price label" object.
Poll: Traders’ Estimate of the Mobile Terminal
Poll: Traders’ Estimate of the Mobile Terminal

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 resolve this ambiguity we decided to conduct a survey among traders to find out their opinion about our mobile terminals. Through the efforts of this survey, we have managed to established a clear picture of what our clients currently think about the product as well as their requests and wishes in future developments of our mobile terminals.
How to Become a Participant of Automated Trading Championship 2008?
How to Become a Participant of Automated Trading Championship 2008?

How to Become a Participant of Automated Trading Championship 2008?

The main purpose of the Championship is to popularize automated trading and accumulate practical information in this field of knowledge. As the Organizer of the Championship, we are doing our best to provide a fair competition and suppress all attempts to “play booty”. It is this reasoning that sets the strict Rules of the Championship.
All about Automated Trading Championship: Interviews with the Participants'07
All about Automated Trading Championship: Interviews with the Participants'07

All about Automated Trading Championship: Interviews with the Participants'07

The published interviews of Championship 2007 bear the stamp of the results obtained during the preceding contest. The first Championship evoked a wide response on the internet and in printings. The leading developer of the MetaQuotes Software Corp. tells about changes made to the forthcoming Automated Trading Championship 2007. We put our questions to the developer of a well-known indicating complex ZUP, Eugeni Neumoin (nen) and spoke to an equity trader, Alexander Pozdnishev (AlexSilver).
All about Automated Trading Championship: Additional Materials of Championships 2006-2007
All about Automated Trading Championship: Additional Materials of Championships 2006-2007

All about Automated Trading Championship: Additional Materials of Championships 2006-2007

We present to you a selection of these materials that are divided into several parts. The present one contains additional materials about automated trading, Expert Advisors development, etc.
Method of Determining Errors in Code by Commenting
Method of Determining Errors in Code by Commenting

Method of Determining Errors in Code by Commenting

The article describes a method of searching the errors in the MQL4 code that is based on commenting. This method is found to be a useful one in case of problems occuring during the compilation caused by the errors in a reasonably large code.
All about Automated Trading Championship: Interviews with the Participants'06
All about Automated Trading Championship: Interviews with the Participants'06

All about Automated Trading Championship: Interviews with the Participants'06

Interviews with the Participants of Automated Trading Championship 2006 demonstrated a great variety of views of automated trading and trading as a whole. You can see yourselves which ideas turned out to work better during the Championship and which of them could not pass the critical verification through a three-month long "test-drive" on a contest account.
All about Automated Trading Championship: Registration
All about Automated Trading Championship: Registration

All about Automated Trading Championship: Registration

This article comprises useful materials that will help you learn more about the procedure of registration for participation in the Automated Trading Championship.
All about Automated Trading Championship: Reporting the Championship 2007
All about Automated Trading Championship: Reporting the Championship 2007

All about Automated Trading Championship: Reporting the Championship 2007

The present article contains Weekly Reports of the ATC 2007. These materials are like snapshots, they are interesting-to-read not only during the Championship, but years later as well.
All about Automated Trading Championship: Reporting the Championship 2006
All about Automated Trading Championship: Reporting the Championship 2006

All about Automated Trading Championship: Reporting the Championship 2006

This article contains Weekly Reports of the ATC 2006. These materials are like snapshots, they are interesting-to-read not only during the Championship, but years later as well.