Articles with MQL4 programming examples

icon

Access a huge collection of articles with code examples showing how to create indicators and trading robots for the MetaTrader platform in the MQL5 language. Source codes are attached to the articles, so you can open them in MetaEditor and run them to see how the applications work.

These articles will be useful both for those who have just started exploring automated trading and for professional traders with programming experience. They feature not only examples, but also contain new ideas.

Add a new article
latest | best
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 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.
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?
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.
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.
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.
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.