All (not yet) about Strategy Tester, Optimization and Cloud - page 2

To add comments, please log in or register
Sergey Golubev
Moderator
109165
Sergey Golubev  

Forum on trading, automated trading systems and testing trading strategies

MT4 & MT5 backtest

Sergey Golubev, 2017.02.17 20:53

If you are backtesting EA on MT5 using 'every tick based on real ticks' so it will be almost same with trading on MT5 platform with some particular broker (because it is based on actual historical data).

Example, read this thread: Why is it better MT5 than MT4?? Does it have fewer limitations ??? - this is the quote from the first post of the thread:

  • In MT5 you can backtesting robots with the closest possible conditions to the real market natively  (real tick data, real variable spreads, lag, slippage, etc). In MT4 you can't natively. You only can if you pay for a third-party software. If so, you also have to download history data from a few sources (there are many few, almost everyone uses the same source), transform it to MT4 format and open the platform through this third-party software in order to patch MT4 behavior. You take many hours to complete this process, and you have to repeat it every time you want to incorporate new data. 
    We have all seen hundreds of robots that obtained spectacular results in backtesting, but when operating in real account the results were very bad. This is mainly because they were made with conditions that had nothing to do with real market conditions.

--------------

As i know - some coders/traders are converting their MT4 EAs to MT5 just to backtest them and/or to find the settings with optimization to get the backtesting results that are closest to reality. 


Sergey Golubev
Moderator
109165
Sergey Golubev  
The article:

Testing trading strategies on real ticks

The article provides the results of testing a simple trading strategy in three modes: "1 minute OHLC" using only Open, High, Low and Close prices of minute bars; detailed modeling in "Every tick" mode, as well as the most accurate "Every tick based on real ticks" mode applying actual historical data.

Comparing the results allows us to assess the quality in various modes, as well as helps us to use the tester more efficiently in order to receive results faster. "1 minute OHLC" mode allows receiving quick estimated test results, "Every tick" mode is closer to reality, while testing on real ticks is most accurate but time-consuming. Keep in mind that errors in a trading robot's logic may affect the number of trading operations making the strategy test results more susceptible to a selected test mode.


Sergey Golubev
Moderator
109165
Sergey Golubev  

More article:

Genetic algorithms - it's easy!

Genetic algorithm (GA) refers to the heuristic algorithm (EA), which gives an acceptable solution to the problem in the majority of practically significant cases, but the correctness of the decisions has not been proven mathematically, and is used most often for problems, the analytical solution of which is very difficult or even impossible.

A classic example of a problem of this class (class NP) is a "traveling salesman problem" (is one of the most famous combinatorial optimization problems). The main challenge is finding the most advantageous route, which passes through the given cities at least one time, and then returns to the initial city). But nothing prevents to use them for tasks, which yield to formalization.

EA are widely used for solving problems of high computational complexity, instead of going through all of the options, which takes up a significant amount of time. They are used in the fields of artificial intelligence, such as pattern recognition, in antivirus software, engineering, computer games, and other areas.

It should be mentioned that MetaQuotes Software Corp. uses GA in their software products of MetaTrader4 / 5. We all know about the strategy tester and about how much time and effort can be saved by using a built-in strategy optimizer, in which, just like with the direct enumeration, it is possible to optimize with the use of GA. In addition, the MetaTrader 5 tester allows us to use the user optimization criteria. Perhaps the reader will be interested in reading the articles about theGAand the advantages, provided by EA, in contrast todirect enumeration.


Sergey Golubev
Moderator
109165
Sergey Golubev  

More article related:

Creating custom criteria of optimization of expert advisors 

The MetaTrader 5 Client Terminal offers a wide range of opportunities for optimization of Expert Advisor parameters. In addition to the optimization criteria included in the strategy tester, developers are given the opportunity of creating their own criteria. This leads to an almost limitless number of possibilities of testing and optimizing of Expert Advisors. The article describes practical ways of creating such criteria - both complex and simple ones.

Sergey Golubev
Moderator
109165
Sergey Golubev  

Neural network: Self-optimizing Expert Advisor  

After we have defined our strategy and implemented it in our Expert Advisor, we face two issues that may completely invalidate our efforts.

  • What are the most suitable input values?
  • How long do these values remain reliable? When do we need to perform a re-optimization?
Apart from predefined parameters (symbol, timeframe, etc.), there are other (editable) settings: indicator calculation period, buy/sell levels, TP/SL levels, etc. This may cause some issues when using the EA.

Is it possible to develop an Expert Advisor able to optimize position open and close conditions at defined intervals?

Sergey Golubev
Moderator
109165
Sergey Golubev  
Sergey Golubev
Moderator
109165
Sergey Golubev  

And this is something which may be important for example:

============

MetaTrader 5 Help → MQL5 Cloud Network → How to Participate - Restrictions of Participation on MQL5 Cloud Network 

There are several limitations of participation on MQL5 Cloud Network:

  • An agent should have at least 768 MB of available physical memory to perform calculations.
  • To connect your agents to the MQL5 Cloud Network, the computer where the agents are installed must have at least 2048MB of RAM.
  • The agent's productivity index (PR) should not be less than 50.
  • Agents installed on a virtual machine cannot participate in MQL5 Cloud Network.
  • Agents having PR below 100 are not used in genetic optimization in order not to slow down the calculation process. The reason is that the calculation is performed by generations (256 passes). While one generation is not calculated, calculation of the next one cannot start. Even if a single pass out of 256 ones is calculated by a low PR agent, the total calculation speed is reduced.
  • An agent will not be able to receive new tasks from the MQL5 Cloud Network if the free disk space on the computer where the agent is installed falls below 500MB.
  • Agents do not receive tasks from the cloud network in case the PC they are installed at is powered by a battery (it refers to laptops).
MetaTrader 5 Help
MetaTrader 5 Help
  • www.metatrader5.com
The Trading Platform is the trader's working tool, providing all the necessary features for a successful online trading. It includes trading...
Sergey Golubev
Moderator
109165
Sergey Golubev  

Multi-Currency Expert Advisors in MT5  - backtesting and optimization

 

The threads/posts

  • Buying or Selling all 7 pairs - the thread with the explanation.
  • Multi-Currency Expert Advisors the post with the examples of backtesting/optimization

The articles

Documentation

  • MetaTrader 5 Help → Algorithmic Trading, Trading Robots → Optimization Types - All Symbols Selected in Market Watch
  • MetaTrader 5 Help → Algorithmic Trading, Trading Robots → Strategy Testing - Multi-Currency Expert Advisors
  • MetaTrader 5 Help - Trading Platform — User Manual

Optimization Types - Algorithmic Trading, Trading Robots - MetaTrader 5 Help
Optimization Types - Algorithmic Trading, Trading Robots - MetaTrader 5 Help
  • www.metatrader5.com
This type of optimization is based on the genetic algorithm of search for the best values of input parameters. This type is much faster than the first one and is almost of the same quality. The slow complete optimization that would take several years can be performed within several hours using the genetic algorithm. Each individual has a...
Sergey Golubev
Moderator
109165
Sergey Golubev  

Good thread was started - 

----------------

MT4 Strategy Tester : good practices, know-how and howtos 

This topic is NOT to ask questions, it will be used as a reference.

To add comments, please log in or register