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
Graphic Expert Advisor: AutoGraf
Graphic Expert Advisor: AutoGraf

Graphic Expert Advisor: AutoGraf

The article shows the workability of graphics in creation of a convenient interface to manage trading.
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.
Multiple Null Bar Re-Count in Some Indicators
Multiple Null Bar Re-Count in Some Indicators

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 code some extra program items that allow to restore program code saved before multiple re-counting.
Secrets of the MetaTrader 4 Client Terminal: Indicators
Secrets of the MetaTrader 4 Client Terminal: Indicators

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 integrated indicators' characteristics; special features and methods of attaching indicators to a chart; building of levels; displaying of indicators on different timeframes.
Secrets of MetaTrader 4 Client Terminal: Alerting System
Secrets of MetaTrader 4 Client Terminal: Alerting System

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 SMTP server access; publications; setting up FTP server access.
Secrets of MetaTrader 4 Client Terminal
Secrets of MetaTrader 4 Client Terminal

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; Market Watch; templates for testing and independent charts; profiles; crosshair; electronic ruler; barwise chart paging; account history in the chart; types of pending orders; modifying of StopLoss and TakeProfit; undo deletion; chart print.
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.
A Pause between Trades
A Pause between Trades

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 working with the terminal and programming in MQL 4.
MagicNumber: "Magic" Identifier of the Order
MagicNumber: "Magic" Identifier of the Order

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 "someone else's" positions (opened manually or by other experts). The article was written for users who have basic skills of working with the terminal and programming in MQL 4.
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.
Working with Files. An Example of Important Market Events Visualization
Working with Files. An Example of Important Market Events Visualization

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
Error 146 ("Trade context busy") and How to Deal with It

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.
Free-of-Holes Charts
Free-of-Holes Charts

Free-of-Holes Charts

The article deals with realization of charts without skipped bars.
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
Expert Advisor Sample
Expert Advisor Sample

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.
Testing Features and Limits in MetaTrader 4
Testing Features and Limits in MetaTrader 4

Testing Features and Limits in MetaTrader 4

This article allows to find out more about features and limits of Strategy Tester in MetaTrader 4.
Features of Custom Indicators Creation
Features of Custom Indicators Creation

Features of Custom Indicators Creation

Creation of Custom Indicators in the MetaTrader trading system has a number of features.
Features of Experts Advisors
Features of Experts Advisors

Features of Experts Advisors

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