Articles on strategy testing in MQL5

How to develop, write and test a trading strategy, how to find the optimal system parameters and how to analyze the results? The MetaTrader platform offers developers of trading robots rich functionality for fast and accurate testing of trading ideas. Read these articles to learn how to test multi-currency robots and how to use MQL5 Cloud Network for optimization purposes.

Developers of automated trading systems are recommended to start with the testing fundamentals and tick generation algorithms in the strategy tester.

latest | best
12

100 best optimization passes (part 1). Developing optimization analyzer

The article dwells on the development of an application for selecting the best optimization passes using several possible options. The application is able to sort out the optimization results by a...

Modeling time series using custom symbols according to specified distribution laws

The article provides an overview of the terminal's capabilities for creating and working with custom symbols, offers options for simulating a trading history using custom symbols, trend and various...

Using indicators for optimizing Expert Advisors in real time

Efficiency of any trading robot depends on the correct selection of its parameters (optimization). However, parameters that are considered optimal for one time interval may not retain their...

Automated Optimization of an EA for MetaTrader 5

This article describes the implementation of a self-optimization mechanism under MetaTrader 5.

Developing stock indicators featuring volume control through the example of the delta indicator

The article deals with the algorithm of developing stock indicators based on real volumes using the CopyTicks() and CopyTicksRange() functions. Some subtle aspects of developing such indicators, as...

Visualizing optimization results using a selected criterion

In the article, we continue to develop the MQL application for working with optimization results. This time, we will show how to form the table of the best results after optimizing the parameters by...

Applying the Monte Carlo method for optimizing trading strategies

Before launching a robot on a trading account, we usually test and optimize it on quotes history. However, a reasonable question arises: how can past results help us in the future? The article...

Visual strategy builder. Creating trading robots without programming

This article presents a visual strategy builder. It is shown how any user can create trading robots and utilities without programming. Created Expert Advisors are fully functional and can be tested in...

Processing optimization results using the graphical interface

This is a continuation of the idea of processing and analysis of optimization results. This time, our purpose is to select the 100 best optimization results and display them in a GUI table. The user...

Multi-symbol balance graph in MetaTrader 5

The article provides an example of an MQL application with its graphical interface featuring multi-symbol balance and deposit drawdown graphs based on the last test results.

Visualizing trading strategy optimization in MetaTrader 5

The article implements an MQL application with a graphical interface for extended visualization of the optimization process. The graphical interface applies the last version of EasyAndFast library....

Controlled optimization: Simulated annealing

The Strategy Tester in the MetaTrader 5 trading platform provides only two optimization options: complete search of parameters and genetic algorithm. This article proposes a new method for optimizing...

Custom Strategy Tester based on fast mathematical calculations

The article describes the way to create a custom strategy tester and a custom analyzer of the optimization passes. After reading it, you will understand how the math calculations mode and the...

Resolving entries into indicators

Different situations happen in trader’s life. Often, the history of successful trades allows us to restore a strategy, while looking at a loss history we try to develop and improve it. In both cases,...

Mini Market Emulator or Manual Strategy Tester

Mini Market Emulator is an indicator designed for partial emulation of work in the terminal. Presumably, it can be used to test "manual" strategies of market analysis and trading.

Optimizing a strategy using balance graph and comparing results with "Balance + max Sharpe Ratio" criterion

In this article, we consider yet another custom trading strategy optimization criterion based on the balance graph analysis. The linear regression is calculated using the function from the ALGLIB...

TradeObjects: Automation of trading based on MetaTrader graphical objects

The article deals with a simple approach to creating an automated trading system based on the chart linear markup and offers a ready-made Expert Advisor using the standard properties of the MetaTrader...

Creating and testing custom symbols in MetaTrader 5

Creating custom symbols pushes the boundaries in the development of trading systems and financial market analysis. Now traders are able to plot charts and test trading strategies on an unlimited...

The Flag Pattern

The article provides the analysis of the following patterns: Flag, Pennant, Wedge, Rectangle, Contracting Triangle, Expanding Triangle. In addition to analyzing their similarities and differences, we...

Custom Walk Forward optimization in MetaTrader 5

The article deals with the approaches enabling accurate simulation of walk forward optimization using the built-in tester and auxiliary libraries implemented in MQL.

Trading with Donchian Channels

In this article, we develop and tests several strategies based on the Donchian channel using various indicator filters. We also perform a comparative analysis of their operation.

How Long Is the Trend?

The article highlights several methods for trend identification aiming to determine the trend duration relative to the flat market. In theory, the trend to flat rate is considered to be 30% to 70%....

Comparative Analysis of 10 Trend Strategies

The article provides a brief overview of ten trend following strategies, as well as their testing results and comparative analysis. Based on the obtained results, we draw a general conclusion about...

An Example of Developing a Spread Strategy for Moscow Exchange Futures

The MetaTrader 5 platform allows developing and testing trading robots that simultaneously trade multiple financial instruments. The built-in Strategy Tester automatically downloads required tick...

LifeHack for trader: "Quiet" optimization or Plotting trade distributions

Analysis of the trade history and plotting distribution charts of trading results in HTML depending on position entry time. The charts are displayed in three sections - by hours, by days of the week...

How to quickly develop and debug a trading strategy in MetaTrader 5

Scalping automatic systems are rightfully regarded the pinnacle of algorithmic trading, but at the same time their code is the most difficult to write. In this article we will show how to build...

LifeHack for trader: four backtests are better than one

Before the first single test, every trader faces the same question — "Which of the four modes to use?" Each of the provided modes has its advantages and features, so we will do it the easy way - run...

Testing trading strategies on real ticks

The article provides the results of testing a simple trading strategy in three modes: "1 minute OHLC", "Every tick" and "Every tick based on real ticks" using actual historical data.

The checks a trading robot must pass before publication in the Market

Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by...

LifeHack for Traders: Indicators of Balance, Drawdown, Load and Ticks during Testing

How to make the testing process more visual? The answer is simple: you need to use one or more indicators in the Strategy Tester, including a tick indicator, an indicator of balance and equity, an...

MQL5 Cookbook: Saving Optimization Results of an Expert Advisor Based on Specified Criteria

We continue the series of articles on MQL5 programming. This time we will see how to get results of each optimization pass right during the Expert Advisor parameter optimization. The implementation...

MQL5 Cookbook: Reducing the Effect of Overfitting and Handling the Lack of Quotes

Whatever trading strategy you use, there will always be a question of what parameters to choose to ensure future profits. This article gives an example of an Expert Advisor with a possibility to...

MQL5 Cookbook: Writing the History of Deals to a File and Creating Balance Charts for Each Symbol in Excel

When communicating in various forums, I often used examples of my test results displayed as screenshots of Microsoft Excel charts. I have many times been asked to explain how such charts can be...

MQL5 Cookbook: Developing a Multi-Currency Expert Advisor with Unlimited Number of Parameters

In this article, we will create a pattern that uses a single set of parameters for optimization of a trading system, while allowing for unlimited number of parameters. The list of symbols will be...

MQL5 Cookbook: Multi-Currency Expert Advisor - Simple, Neat and Quick Approach

This article will describe an implementation of a simple approach suitable for a multi-currency Expert Advisor. This means that you will be able to set up the Expert Advisor for testing/trading under...

MQL5 Cookbook: Developing a Framework for a Trading System Based on the Triple Screen Strategy

In this article, we will develop a framework for a trading system based on the Triple Screen strategy in MQL5. The Expert Advisor will not be developed from scratch. Instead, we will simply modify the...

MQL5 Cookbook: Using Indicators to Set Trading Conditions in Expert Advisors

In this article, we will continue to modify the Expert Advisor we have been working on throughout the preceding articles of the MQL5 Cookbook series. This time, the Expert Advisor will be enhanced...

MQL5 Cookbook: The History of Deals And Function Library for Getting Position Properties

It is time to briefly summarize the information provided in the previous articles on position properties. In this article, we will create a few additional functions to get the properties that can only...

Debugging MQL5 Programs

This article is intended primarily for the programmers who have already learned the language but have not fully mastered the program development yet. It reveals some debugging techniques and presents...

MQL5 Cookbook: How to Avoid Errors When Setting/Modifying Trade Levels

In continuation of our work on the Expert Advisor from the previous article of the series called "MQL5 Cookbook: Analyzing Position Properties in the MetaTrader 5 Strategy Tester", we will enhance it...