Articles on trading system automation in MQL4

icon

Read articles on the trading systems with a wide variety of ideas at the core. Learn how to use statistical methods and patterns on candlestick charts, how to filter signals and where to use semaphore indicators.

The MQL5 Wizard will help you create robots without programming to quickly check your trading ideas. Use the Wizard to learn about genetic algorithms.

Add a new article
latest | best
12
How to conduct a qualitative analysis of trading signals and select the best of them
How to conduct a qualitative analysis of trading signals and select the best of them

How to conduct a qualitative analysis of trading signals and select the best of them

The article deals with evaluating the performance of Signals Providers. We offer several additional parameters highlighting signal trading results from a slightly different angle than in traditional approaches. The concepts of the proper management and perfect deal are described. We also dwell on the optimal selection using the obtained results and compiling the portfolio of multiple signal sources.
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.
Angles in Trading. Further Study Required
Angles in Trading. Further Study Required

Angles in Trading. Further Study Required

In this article, we discuss the method of trading analysis by measuring angles in the MetaTrader 4 terminal. The article provides a general plan of using angles for trend movement analysis, as well as non-standard ways to the practical application of angle analysis in trading. The article also provides conclusions that can be useful for trading.
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.
Trading Ideas Based on Prices Direction and Movement Speed
Trading Ideas Based on Prices Direction and Movement Speed

Trading Ideas Based on Prices Direction and Movement Speed

The article provides a review of an idea based on the analysis of prices' movement direction and their speed. We have performed its formalization in the MQL4 language presented as an expert advisor to explore viability of the strategy being under consideration. We also determine the best parameters via check, examination and optimization of an example given in the article.
Portfolio trading in MetaTrader 4
Portfolio trading in MetaTrader 4

Portfolio trading in MetaTrader 4

The article reveals the portfolio trading principles and their application to Forex market. A few simple mathematical portfolio arrangement models are considered. The article contains examples of practical implementation of the portfolio trading in MetaTrader 4: portfolio indicator and Expert Advisor for semi-automated trading. The elements of trading strategies, as well as their advantages and pitfalls are described.
How to Develop a Profitable Trading Strategy
How to Develop a Profitable Trading Strategy

How to Develop a Profitable Trading Strategy

This article provides an answer to the question: "Is it possible to formulate an automated trading strategy based on history data with neural networks?".
Using Neural Networks In MetaTrader
Using Neural Networks In MetaTrader

Using Neural Networks In MetaTrader

This article shows you how to easily use Neural Networks in your MQL4 code taking advantage of best freely available artificial neural network library (FANN) employing multiple neural networks in your code.
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.
The Golden Rule of Traders
The Golden Rule of Traders

The Golden Rule of Traders

In order to make profits based on high expectations, we must understand three basic principles of good trading: 1) know your risk when entering the market; 2) cut your losses early and allow your profit to run; 3) know the expectation of your system – test and adjust it regularly. This article provides a program code trailing open positions and actualizing the second golden principle, as it allows profit to run for the highest possible level.
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.
Mechanical Trading System "Chuvashov's Fork"
Mechanical Trading System "Chuvashov's Fork"

Mechanical Trading System "Chuvashov's Fork"

This article draws your attention to the brief review of the method and program code of the mechanical trading system based on the technique proposed by Stanislav Chuvashov. The market analysis considered in the article has something in common with Thomas DeMark's approach to drawing trend lines for the last closest time interval, fractals being the reference points in the construction of trend lines.
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.
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.
Fuzzy logic to create manual trading strategies
Fuzzy logic to create manual trading strategies

Fuzzy logic to create manual trading strategies

This article suggests the ways of improving manual trading strategy by applying fuzzy set theory. As an example we have provided a step-by-step description of the strategy search and the selection of its parameters, followed by fuzzy logic application to blur overly formal criteria for the market entry. This way, after strategy modification we obtain flexible conditions for opening a position that has a reasonable reaction to a market situation.
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.
Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization
Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization

Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization

This article dwells on implementation algorithm of simplest trading systems. The article will be useful for beginning traders and EA writers.
Events in МetaТrader 4
Events in МetaТrader 4

Events in МetaТrader 4

The article deals with programmed tracking of events in the МetaТrader 4 Client Terminal, such as opening/closing/modifying orders, and is targeted at a user who has basic skills in working with the terminal and in programming in MQL 4.
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.
How to Evaluate the Expert Testing Results
How to Evaluate the Expert Testing Results

How to Evaluate the Expert Testing Results

The article gives formulas and the calculation order for data shown in the Tester report.
Testing (Optimization) Technique and Some Criteria for Selection of the Expert Advisor Parameters
Testing (Optimization) Technique and Some Criteria for Selection of the Expert Advisor Parameters

Testing (Optimization) Technique and Some Criteria for Selection of the Expert Advisor Parameters

There is no trouble finding the Holy Grail of testing, it is however much more difficult to get rid of it. This article addresses the selection of the Expert Advisor operating parameters with automated group processing of optimisation and testing results upon maximum utilisation of the Terminal performance capabilities and minimum end user load.
On Methods of Technical Analysis and Market Forecasting
On Methods of Technical Analysis and Market Forecasting

On Methods of Technical Analysis and Market Forecasting

The article demonstrates the capabilities and potential of a well-known mathematical method coupled with visual thinking and an "out of the box" market outlook. On the one hand, it serves to attract the attention of a wide audience as it can get the creative minds to reconsider the trading paradigm as such. And on the other, it can give rise to alternative developments and program code implementations regarding a wide range of tools for analysis and forecasting.
Evaluating the effectiveness of trading systems by analyzing their components
Evaluating the effectiveness of trading systems by analyzing their components

Evaluating the effectiveness of trading systems by analyzing their components

This article explores the effectiveness of complex trading systems by analyzing the efficiency of its individual components. Any analysis, whether it is graphic, based on indicators, or any other, is one of the key components of successful trading in financial markets. This article is to some extent a research of few simple and independent trading systems for analyzing their effectiveness and usefulness of the joint application.
Universal Expert Advisor Template
Universal Expert Advisor Template

Universal Expert Advisor Template

The article will help newbies in trading to create flexibly adjustable Expert Advisors.
Layman's Notes: ZigZag…
Layman's Notes: ZigZag…

Layman's Notes: ZigZag…

Surely, a fey thought to trade closely to extremums visited every apprentice trader when he/she saw "enigmatic" polyline for the first time. It's so simple, indeed. Here is the maximum. And there is the minimum. A beautiful picture on the history. And what is in practice? A ray is drawn. It should seem, that is it, the peak! It is time to sell. And now we go down. But hell no! The price is treacherously moving upwards. Haw! It's a trifle, not an indicator. And you throw it out!
Synthetic Bars - A New Dimension to Displaying Graphical Information on Prices
Synthetic Bars - A New Dimension to Displaying Graphical Information on Prices

Synthetic Bars - A New Dimension to Displaying Graphical Information on Prices

The main drawback of traditional methods for displaying price information using bars and Japanese candlesticks is that they are bound to the time period. It was perhaps optimal at the time when these methods were created but today when the market movements are sometimes too rapid, prices displayed in a chart in this way do not contribute to a prompt response to the new movement. The proposed price chart display method does not have this drawback and provides a quite familiar layout.
The Magic of Filtration
The Magic of Filtration

The Magic of Filtration

Most of the automated trading systems developers use some form of trading signals filtration. In this article, we explore the creation and implementation of bandpass and discrete filters for Expert Advisors, to improve the characteristics of the automated trading system.
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.
Indicator Taichi - a Simple Idea of Formalizing the Values of Ichimoku Kinko Hyo
Indicator Taichi - a Simple Idea of Formalizing the Values of Ichimoku Kinko Hyo

Indicator Taichi - a Simple Idea of Formalizing the Values of Ichimoku Kinko Hyo

Hard to interpret Ichimoku signals? This article introduces some principles of formalizing values and signals of Ichimoku Kinko Hyo. For visualization of its usage the author chose the currency pair EURUSD based on his own preferences. However, the indicator can be used on any currency pair.
Research of Statistical Recurrences of Candle Directions
Research of Statistical Recurrences of Candle Directions

Research of Statistical Recurrences of Candle Directions

Is it possible to predict the behavior of the market for a short upcoming interval of time, based on the recurring tendencies of candle directions, at specific times throughout the day? That is, If such an occurrence is found in the first place. This question has probably arisen in the mind of every trader. The purpose of this article is to attempt to predict the behavior of the market, based on the statistical recurrences of candle directions during specific intervals of time.
How Reliable is Night Trading?
How Reliable is Night Trading?

How Reliable is Night Trading?

The article covers the peculiarities of night flat trading on cross currency pairs. It explains where you can expect profits and why great losses are not unlikely. The article also features an example of the Expert Advisor developed for night trading and talks about the practical application of this strategy.
Free-of-Holes Charts
Free-of-Holes Charts

Free-of-Holes Charts

The article deals with realization of charts without skipped bars.
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.
Lite_EXPERT2.mqh: Expert Advisor Implementation Examples
Lite_EXPERT2.mqh: Expert Advisor Implementation Examples

Lite_EXPERT2.mqh: Expert Advisor Implementation Examples

In this article, the author continues to familiarize the readers with the Lite_EXPERT2.mqh functions using real Expert Advisor implementation examples. The article deals with the idea of using floating pending orders and pending orders that vary dynamically from deal to deal which are determined based on Average True Range (ATR) indicator values.
Checking the Myth: The Whole Day Trading Depends on How the Asian Session Is Traded
Checking the Myth: The Whole Day Trading Depends on How the Asian Session Is Traded

Checking the Myth: The Whole Day Trading Depends on How the Asian Session Is Traded

In this article we will check the well-known statement that "The whole day trading depends on how the Asian session is traded".
Econometrics EURUSD One-Step-Ahead Forecast
Econometrics EURUSD One-Step-Ahead Forecast

Econometrics EURUSD One-Step-Ahead Forecast

The article focuses on one-step-ahead forecasting for EURUSD using EViews software and a further evaluation of forecasting results using the programs in EViews. The forecast involves regression models and is evaluated by means of an Expert Advisor developed for MetaTrader 4.
How to Make the Detection and Recovery of Errors in an Expert Advisor Code Easier
How to Make the Detection and Recovery of Errors in an Expert Advisor Code Easier

How to Make the Detection and Recovery of Errors in an Expert Advisor Code Easier

In Export Advisors development, the questions of code errors detection and recovery are very important. The peculiarity is that a not detected in time error may ruin a precious idea of a trading system already on the stage of its first testings. That is why any sensible EA developer takes into account such problems from the very beginning. This article dwells on some approaches, helping in this difficult matter.
12