Articles on the MQL4 programming and use of trading robots

icon

Expert Advisors created for the MetaTrader platform perform a variety of functions implemented by their developers. Trading robots can track financial symbols 24 hours a day, copy deals, create and send reports, analyze news and even provide specific custom graphical interface.

The articles describe programming techniques, mathematical ideas for data processing, tips on creating and ordering of trading robots.

Add a new article
latest | best
Price Action. Automating the Engulfing Pattern Trading Strategy
Price Action. Automating the Engulfing Pattern Trading Strategy

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 orders. The results of testing and optimization are provided for your information.
Price Action. Automating the Inside Bar Trading Strategy
Price Action. Automating the Inside Bar Trading Strategy

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. Test and optimization results are provided as well.
Identifying Trade Setups by Support, Resistance and Price Action
Identifying Trade Setups by Support, Resistance and Price Action

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 determination of trade setups. Corresponding MQL4 code is explained that can be utilized in the EAs based on these trading concepts.
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.
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.
Deep neural network with Stacked RBM. Self-training, self-control
Deep neural network with Stacked RBM. Self-training, self-control

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 the "darch" package.
False trigger protection for Trading Robot
False trigger protection for Trading Robot

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 trigger is typical for low quality performance of the main logic of a trading robot. Ways of solving the specified problem are considered in this article.
Orders Management - It's Simple
Orders Management - It's Simple

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.
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.
Mechanical Trading System "Chuvashov's Triangle"
Mechanical Trading System "Chuvashov's Triangle"

Mechanical Trading System "Chuvashov's Triangle"

Let me offer you an overview and the program code of the mechanical trading system based on ideas of Stanislav Chuvashov. Triangle's construction is based on the intersection of two trend lines built by the upper and lower fractals.
MetaTrader 4 Expert Advisor exchanges information with the outside world
MetaTrader 4 Expert Advisor exchanges information with the outside world

MetaTrader 4 Expert Advisor exchanges information with the outside world

A simple, universal and reliable solution of information exchange between МetaТrader 4 Expert Advisor and the outside world. Suppliers and consumers of the information can be located on different computers, the connection is performed through the global IP addresses.
My First "Grail"
My First "Grail"

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 tester, but result in losses during real trading are presented.
Using text files for storing input parameters of Expert Advisors, indicators and scripts
Using text files for storing input parameters of Expert Advisors, indicators and scripts

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 convenient addition to the functionality of standard tools offered by MQL languages.
Thomas DeMark's contribution to technical analysis
Thomas DeMark's contribution to technical analysis

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 using the concepts of Thomas DeMark is demonstrated.
Enhancing the StrategyTester to Optimize Indicators Solely on the Example of Flat and Trend Markets
Enhancing the StrategyTester to Optimize Indicators Solely on the Example of Flat and Trend Markets

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 specific purpose, but as well we can decide whether this indicator will meet our needs and get to know the average range of the flat and trend markets which might be quite important to determine stops and targets of the markets.
Genetic Algorithms vs. Simple Search in the MetaTrader 4 Optimizer
Genetic Algorithms vs. Simple Search in the MetaTrader 4 Optimizer

Genetic Algorithms vs. Simple Search in the MetaTrader 4 Optimizer

The article compares the time and results of Expert Advisors' optimization using genetic algorithms and those obtained by simple search.
Genetic Algorithms: Mathematics
Genetic Algorithms: Mathematics

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. At this, the genetic algorithm is based on the random search method.
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.
Synchronization of Expert Advisors, Scripts and Indicators
Synchronization of Expert Advisors, Scripts and Indicators

Synchronization of Expert Advisors, Scripts and Indicators

The article considers the necessity and general principles of developing a bundled program that would contain both an Expert Advisor, a script and an indicator.
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.
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.
Information Storage and View
Information Storage and View

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.
Contest of Expert Advisors inside an Expert Advisor
Contest of Expert Advisors inside an Expert Advisor

Contest of Expert Advisors inside an Expert Advisor

Using virtual trading, you can create an adaptive Expert Advisor, which will turn on and off trades at the real market. Combine several strategies in a single Expert Advisor! Your multisystem Expert Advisor will automatically choose a trade strategy, which is the best to trade with at the real market, on the basis of profitability of virtual trades. This kind of approach allows decreasing drawdown and increasing profitability of your work at the market. Experiment and share your results with others! I think many people will be interested to know about your portfolio of strategies.
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.
MQL4  as a Trader's Tool, or The Advanced Technical Analysis
MQL4  as a Trader's Tool, or The Advanced Technical Analysis

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. It comes that the major of newcomers in trading study "ready-made" trading theories. But, as luck would have it, there are some more undiscovered market secrets, and tools used in analyzing of price movements exist, basically, as those unrealized technical indicators or math and stat packages. Thanks awfully to Bill Williams for his contribution to the market movements theory. Though, perhaps, it's too early to rest on oars.
Expert System 'Commentator'. Practical Use of Embedded Indicators in an MQL4 Program
Expert System 'Commentator'. Practical Use of Embedded Indicators in an MQL4 Program

Expert System 'Commentator'. Practical Use of Embedded Indicators in an MQL4 Program

The article describes the use of technical indicators in programming on MQL4.