Automated Trading & Algorithmic Trading Software

Managing a trade account using a computer program is called Automated Trading or Algorithmic Trading. Such programs can analyze forex quotes or stock quotes and execute trade operations. Automated forex trading software are actually trading robots that fully take trader’s place.

Algorithmic trading is integrated into MetaTrader 5! Trading Platform includes a full-featured Integrated Development Environment (IDE) that includes all necessary components and allows traders to create, debug, test, optimize and run automated trading software.

In MetaTrader 5 algo trading programs are known as Expert Advisors or Trading Robots.

The core of the IDE is the high-level programming language MQL5 (MetaQuotes Language 5). All trading robots (so-called Expert Advisors), custom technical indicators, scripts and libraries are created using this language. The language itself is very powerful and flexible. MQL5 allows you to control almost every aspect of your auto trading strategy or market analysis. The high speed of the language allows traders to create very complex programs with large amount of calculations.

Editing Trading Robot in MetaEditorThe best way to write MQL5 programs is to use ourspecial-purpose MetaEditor. This editor was created especially for MQL5 language and it allows compiling the source code into an forex Expert Advisor, custom technical indicator, script and library. MetaEditor built-in debugger purpose is to find errors as you develop your MQL5 programs.

An important feature of MetaEditor is its direct connection with the  MQL5.community. Access to MQL5 documentation and articles can be granted directly from the editor interface. Moreover, you can download ready-to-use MQL5 programs right into MetaEditor for further compilation and editing.

MQL5 Integrated Development Environment:

  • MQL5 Language
  • MetaEditor with debugging features
  • Strategy Tester that supports optimization
  • MetaTrader 5 Trading Platform

After compilation, MQL5 programs are available inMetaTrader 5 Trading Platform, where they can be used. In no time you can apply technical indicators on a chart and start to analyze dynamics of a financial instrument or you can run an Expert Advisors to start automatic forex trading. Of course at first, it’s advisable to test them in the Strategy Tester.

Strategy Tester is an extraordinary powerful tool for developers of robot trading. Before you start your automated trading application in real trade, you can assess its profitability, risk level, stability and other parameters in the Strategy Tester. Testing is based on historical data available for the selected financial instrument. These data reflect the unique features of its dynamics.

Optimization of Expert Advisors is another core feature of the Strategy Tester. The purpose of optimization is to find the best values of Expert Advisor’s parameters in order to achieve the desired characteristics of forex robot. For example, it can be maximum profit, stability, low level of risk, etc. Strategy Tester supports Genetic Algorithms that  significantly decreases the time of complex optimizations with large number of passes. Distributed optimization also speeds up this process by leveraging additional computational power via local network or Internet.

 

Strategy Tester in MetaTrader 5 Trading Platform
 

MQL5.community

MQL5.com is the place where MQL5 developers and their clients (traders) can interact. This community contains a lot of useful information for developers: complete MQL5 documentation, articles on how to develop and use automated forex programs, Code Base of ready-to-use Expert Advisors and technical indicators. The Forum provides the mean for communication with other MQL5.community members, asking for advice and solving problems together.

 

MQL5.community: Development of Trading Robots, Technical Indicators and Scripts
MQL5.community includes its own Payment System, which facilitates financial transactions between community members. On this basis we’ve successfully launched the Jobs service. Now MQL5.community members can order MQL5 programs from other members. In the near future MQL5.com will be augmented with services that will facilitate negotiations for trade signals and even ready-to-use Expert Advisors. 

Automated Trading Championships

The 5th annual Automated Trading Championship was carried out for MQL5 developers. During this 3 month competition hundreds of Expert Advisor’s developers competed to be the Best Forex Robot Developer 2011.

 

Automated Trading Championship - Trading Robots Competition
Participants’ Expert Advisors traded automatically during three months. Authors of the three best forex robot shared the Championship prize money – $80,000.

Trading Robots and Custom Technical Indicators

Any trader can use trading robots (Expert Advisors) to work on financial markets: Forex, Stocks, Futures & CFD. These powerful programs can take humans place both in market analysis and trading. The main benefits of Expert Advisor is: ability to operate with large amount of calculations, tirelessness and objectivity.

Expert Advisors - Trading Robots in MetaTrader 5 Trading PlatformManual data processing and recalculation of several analytical instruments simultaneously on every tick can take quite a lot of time, while the situation on highly volatile markets (for instance, Forex Market) can change dramatically. With a computer program, such as a forex robot, traders avoid such a drawback and can make various calculations almost instantly and work with large amounts of data. As a result, a trading strategy is enhanced with more detailed real-time signals and thus can determine entry/exit points more precisely.

Robot Forex Trading in MetaTrader 5:

  • Instant processing of large amount of data
  • More precise signals
  • Work 24 hours a day with no loss of work
  • Emotionlessness and strict adherence to a programmed algorithm

Robot trading are inexhaustible and can work 24 hours a day without affecting their effectiveness. Analyzing quotes is a hard and tedious work that every trader is familiar with. Over time human concentration inevitably weakens, which leads to errors in calculations and in the trading platform management. All these drawbacks lead to mistakes in trading and to missing opportunities on financial markets. Automated forex robot in MetaTrader 5 solve this problem: they strictly adhere to the trading algorithm so traders will not miss important market opportunities. For example, by 2 a.m. a trader has already gone to bed, but the forex trading robot continues to perform technical analysis and online trading operations. As the motto goes – “money don’t sleep”.

Finally, trading robots lack such purely human traits as self-confidence, enthusiasm, excitement, etc. All these human traits affect manual trading and therefore the trading activity. Expert Advisors are free from these emotions and operate exactly as they have been programmed. They dispassionately continue to analyze market and can detect the best possible opportunities to increase profit. Thus the emotional factors in trading are neutralized.

 

Automated Trading Championship - Trading Robots Competition
The 2006-2011 Automated Trading Championships obviously confirm the power and benefits of the best Expert Advisors in MetaTrader Trading Platforms. The distinctive feature of this contest is that Expert Advisors are truly stand-alone. Developers are not allowed to alter their programs in any way, during the Championship.As a result, all trading robots are free from human factor. For the three months hundreds of forex Expert Advisors work under equal conditions and achieve impressive results. 

Technical Indicators

Along with trading robots, MQL5 Integrated Development Environment allows to create Custom Technical Indicators. Technically they do not differ from built-in indicators and allow analyzing quote dynamics on financial markets.

Technical Indicators in MetaTrader 5MetaTrader 5 Trading Platform is equipped with an impressive set of built-in technical indicators. It includes the most popular and claimed indicators (Parabolic SAR, Demarker, Bollinger Bands, Moving Average and Macd indicator) that satisfy almost all analytical demands of the modern trader. However, technical analysis course is constantly developing. Every year technical analysts discover new dependencies in price dynamics and create new tools and forex trading systems for market analysis. Not all of them are included in MetaTrader 5, but MQL5 can help in staying up to date.

Do you need some kind of technical indicator? You can create it by yourself! MQL5 allows developing of custom technical indicators that can be used to analyze quotes on forex or stock market.

MQL5 indicators access the entire database of historical information available for selected financial instruments and process these data. Custom Technical Indicators can be placed on a price chart or in a separate sub window. Traders gain full control of calculation parameters and display options of instruments. In other words, MetaTrader 5 Indicators are practically the same as built-in technical indicators and share the same wide range of options for trading on the financial markets.

In addition, MQL5 indicators allow traders to implement any analytical algorithm (forex trading systems) that they want.

To work with Expert Advisors and Custom Indicators, MetaTrader 5 offers MQL5 Integrated Development Environment that includes all the necessary tools to develop, test, debug and run your MQL5 programs.

MQL5 Market – trading robots and custom technical indicators

MQL5 Market is a secure service for buying trading robots, indicators, scripts and other trading programs. The service offers ready-made applications for working on financial markets. The service is available for all MetaTrader 5 users. They can open MQL5 Market, buy a program and launch it right via their terminals at any time.

MQL5 Market logo

MQL5 Market provides a wide range of programs offering efficient solutions even for the most demanding customer. For your convenience, all products are divided into categories, and each category contains both free and paid products. They can also be sorted by popularity, price or other parameters. Besides, each application is provided with a detailed description and screenshots.

Forex robots, custom technical indicators of the MQL5 Market in the MetaTrader 5 Trading Platform
In addition, trading robots and indicators have demo versions allowing customers to test an application before buying it in Market. A demo version can be launched in Strategy Tester to evaluate a program operation on historical data. Visual testing, optimization of input parameters and forward testing – all these features allow customers to examine the program carefully.

Description of an Expert Advisor in MQL5 Market
All performed actions in MQL5 Market are strictly regulated by the Rules. Market sellers pass registration specifying their actual contact details, while applications are tested before publishing. All payments are made in our payment system on MQL5.community website. All operations are carried out using a secure connection over the SSL protocol. Besides, critical operations are confirmed by SMS.

Cooperation of participants in MQL5 Market

You just need to register on www.mql5.com website and deposit your account in any convenient way to start using MQL5 Market. Purchased application will appear in your trading terminal immediately after you pay for it. It will be protected by a unique installation code and will work only on your PC. You will be able to activate a purchased application on any three computers. Usually its enough for traders, and at the same time protects the interests of the developer.

Delivery of an Expert Advisor in MetaTrader 5 via MQL5 Market

Traders have received a convenient and highly secure store offering ready-made programs. Ease of use, ease of selection, demo versions ready to be tested, protected payment system – advantages for buyers are obvious. Program developers can also benefit from MQL5 Market. They receive direct access to all MetaTrader 5 platform users. You do not need to worry about effective promotion methods and reliable payment system any more – MQL5 Market has already solved these issues for you.

Programming of Forex Robot with MetaQuotes Language 5 (MQL5)

MetaQuotes Language 5 (MQL5) is the built-in programming language for automated trading strategies development. It allows creating Expert Advisors (trading robots), Custom Indicators, Scripts and Libraries. All these instruments significantly enhance traders’ ability to trade on financial markets (Forex, Stock, Futures & CFD).

MetaQuotes Language 5 is based on the concepts of the well known and popular С++ programming language. MQL5 is also a high-level object oriented programming language. However, due to its narrow specialization, MQL5 thrives in financial markets challenges.

MQL5 includes numerous functions for forex and stock quotes analysis. Also there are built-in main technical indicators and functions, which control trading positions. Thanks to these possibilities of the programming language, all analytics and trade operations can be made entirely by such MQL5 programs.

MQL5 programs have different properties and purpose:

Expert Advisors - MetaTrader 5 Trading Robots Expert Advisor is a trading robot that totally automates trading on the Forex and Stock Markets. Programs of this type contain the most powerful features to access all analytical information and trading functions, available in MetaTrader 5 Trading Platform. Expert Advisors can analyze the market situation and based on this analysis, execute the assigned trading operations. Such comprehensiveness allows trading robots to fully take humans place when trading in financial markets.Automated Trading Championship conducted from 2006 to 2012 demonstrated the power and self-sufficiency of trading robots. During each of the competitions, hundreds of Expert Advisors traded automatically according to their own trading algorithm. They analyzed market situation and executed trade transactions for a period of three months.
MQL5 Indicators in MetaTrader 5 Custom Indicator is a technical indicator intended purely for forex and stock quotes analysis. Unlike built-in technical indicators, this kind of instruments can be created by traders and implement any algorithm programmed in them. Technical indicators do not have access to trading functions and cannot execute automated trading operations.
MQL5 Scripts in MetaTrader 5 Script is a program intended to perform a single specific action. These programs also access all analytical and trading functions. Unlike robots, Scripts execute trade transactions only once, but not on every tick.
MQL5 Libraries in MetaTrader 5 Library is a set of custom functions. It is intended to store and distribute commonly used algorithms of custom programs (Expert Advisors, Custom Technical Indicators and Scripts). Libraries cannot operate independently.

MQL5 programs significantly enhance traders’ potential in MetaTrader 5. Expert Advisors allow traders to avoid tedious market observation and manual trading on the financial markets. Any analytical tool can be implemented in MQL5 custom technical indicators. Scripts perform relatively easy, but frequent actions.

Free Forex Robot Generator – MQL5 Wizard

The MetaTrader 5 Trading Platform includes the MQL5 Wizard, which allows to quickly generate code of an Expert Advisor (Expert Advisor builder). With MQL5 Wizard, knowledge of programming languages is no longer a prerequisite for creating trading robots. In the past, it really was an impassable obstacle to create automated trading strategies, but the release of the MQL5 Wizard changed the situation radically. With this new expert advisor builder, the programming experience is not required – the application will do all the necessary work to create a free Expert Advisors.

Virtually every MetaTrader Expert Advisor consists of three modules – trading signals, money management and trailing stop. And because the modules can be implemented in various ways, there are a lot of possible combinations of Expert Advisors. Thus, every trader can construct trading robots to their liking. It is only necessary to specify the desired parameters and select the necessary components – and the Expert Advisor Builder will do the rest. The creation of free trading robots has never been so quick and simple. Only four clicks – and the free Expert Advisor is ready to trade according to a user-defined strategy!

 

MQL5 Wizard: Automatic generation of Expert Advisor code
To what trading signals will an MetaTrader Expert Advisor respond? What money management system will it use? How will the trailing stop be implemented? If you can answer to these questions, then it is easy to create an algorithmic trading system. After compilation, you only need to test the Expert Advisor that you have built of blocks, and then optimize it by choosing the best parameters. After these steps, you will get a workable trading robot, completely ready to trade. It will trade in accordance with the selected algorithms of trading signals, money management and trailing stop.The main advantage of the Wizard is its convenience. The program allows simplifying the process of trading robots development, creating different Expert Advisor modules for you. With the new Wizard, the construction of automated trading systems is now available not only to MQL-developers, but also to ordinary traders who do not have any programming skills. 

MQL5 Wizard is the tool for automatic creation of free forex robot in the shortest time, available to the traders who don’t have programming skills. DownloadMetaTrader 5 now and test the MQL5 Wizard.

Developing of Forex Robot Using MetaEditor

MQL5 programs are developed using specialized MetaEditor tool. It complements the MQL5 IDE and is tightly linked with the MetaTrader 5 Trading Platform.

MetaEditor - IDE for Creating Trading Robots, Technical Indicators, Scripts and Libraries.The MetaEditor works with MQL5 program source codes and compiles them into executable files. As the trading robots editor and Trading Platform are interconnected, the compiled forex robots generated become automatically available in MetaTrader 5 and can be instantly executed.

The MetaEditor recognizes various patterns of the language. It provides suggestions on how to use functions and it highlights various elements of the program’s source code. Thus the editor makes navigation through the program code easier and speeds up development process.

The language built-in Help makes it also easier to develop trading robots and technical indicators for financial markets. It will help to find easily how to use a language pattern, technical indicator, which functions to insert and so forth. If additional information is needed, you can always find out more at MQL5.community, which is also integrated into the editor.

 

Developing Technical Indicators in MetaEditor
Developers can access articles and ready-to-use MQL5 programs (Expert Advisors, Technical Indicators, Scripts and Libraries) directly from the MetaEditor. A selected article can be viewed through a web browser, while programs can be downloaded and opened directly in the MetaEditor. After editing and compiling, they can be used in MetaTrader 5 Trading Platform.
MQL5.community: Development of Trading Robots, Technical Indicators and Scripts
Error are inevitable during the development of any kind of program. It’s very difficult to detect these errors by just analyzing the program’s source code. For this reason, a debugger comes in handy, and of course it is integrated in the MetaEditor! This feature allows running MQL5 programs on a step-by-step basis and it controls the values of variables. This way it’s easier to detect an error and to fix it on the spot.The MetaEditor allows producing MQL5 programs while it additionally offers language syntax highlighting, built-in MQL5 help, integration with MQL5.com and MetaTrader 5, and a sophisticated debugger. MQL5 language allows creating forex trading and analysis software of any complexity level, and the MetaEditor makes their development process easier.

Forex Strategy Tester in the MetaTrader 5 Trading Platform

To test how an Expert Advisor (Trading robot) can perform in trading, the built-in Strategy Tester is available in MetaTrader 5 Trading Platform. This powerful tool allows testing the efficiency of an Expert Advisor and detects the best input parameters before it is used for real trading on the Forex or Stock Markets.

The entire operation of the Strategy Tester is based on historical data of the financial instrument. During testing, the Expert Advisor goes through the accumulated quotes and analyzes them one by one. At the same time the trading robot performs virtual transactions in accordance to its trading algorithm. This allows simulation of the price dynamics and assess how the robot would have traded in the past.

 

Setup of Expert Advisor testing in the Strategy Tester
The MetaTrader 5 Strategy Tester allows testing trading robots on multiple currencies. Expert Advisors have access to all the financial instruments in the tester and can perform trading transactions with any of them. This feature allows you to test even more sophisticated Expert Advisors that are capable of analyzing multiple currencies and identify the correlation between them. 
The chart of testing results in the Strategy Tester
The main advantage of testing is the possibility to evaluate a robot performance prior to trading on a real forex account. In addition, it takes only a few minutes in the tester rather than days, weeks or months needed to test an trading robot in the real market. This is an indisputable advantage of the Strategy Tester, but not all of its capabilities. 

Testing Modes

MetaTrader 5 Strategy Tester offers several testing modes providing the optimal speed/quality ratio according to traders’ needs. “Every tick” is used to ensure the best testing accuracy. Simulated conditions are the most realistic in this mode. “1 minute OHLC” is introduced for those who want to test a strategy quickly but accurately enough. Select “Open prices only” if you need very quick and rough estimation or your forex trading strategy is based only on bars’ open prices.

Strategy Tester application areas are not limited only to testing trading robots. It can also be used to solve many math problems involving parameters’ optimization. In this case trading history is not used and the market environment is not simulated giving way to math calculations implemented in an Expert Advisor.

Stress testing makes testing trading robots even more realistic. Random Delay mode simulates network delays when transferring and processing trading requests, as well as delays of requests’ execution by dealers in real trading.

Graphical Display of Test Results

Display of Expert Advisors’ test results is one of the most notable features of the Strategy Tester. Results are shown not only in figures displaying an Expert Advisor’s profit during a test. They are also represented by a great amount of statistical data including profit/loss percentage ratio, number of profitable/loss-making deals, risk factor, expected payoff and much more.

Results of testing strategies are also presented in charts making strategy analysis even more convenient.

 

Charts representing the results of testing Expert Advisors in the Strategy Tester
 

Visual Testing

Extensive information on results of testing strategies for Forex and other markets provides vast opportunities for trading robots’ developers. However, nothing can replace live monitoring of an Expert Advisor’s trading. Visual testing makes it possible to track Expert Advisor’s operation on historical price data in real time:

 

Visual testing of Expert Advisors in the Strategy Tester
All performed deals are displayed on a chart simplifying their analysis. Testing process can be slowed down or stopped to see how trading is performed at any particular time interval. 

Testing Indicators

Visualization mode allows you not only to see your trading robot’s operation in real time. It can also test custom technical indicators. For example, a trader can evaluate an indicator’s behavior on historical data before buying it via Market.

Optimization

Another important utility of the Strategy Tester is the function of optimization, which allows choosing the best input parameters for a specific Expert Advisor. For example, with optimization, you can modify the parameters to achieve maximum profitability, maximum stability, minimum risk and so on.

 

Setup of optimization parameters for a trading robot in the Strategy Tester
During the optimization process one Expert Advisor is tested multiple times with different sets of parameters. After optimization, comparison of the results of all tests is possible, which allows selecting the parameters that provide the best performance of a trading robot.The number of combinations of input parameters in the optimization can be quite large, up to hundreds or even thousands. As a result, the optimization of Expert Advisor can turn into a very extensive process, but still can be significantly shortened. 

Forex Strategy Tester supports genetic algorithms. This feature disables the serial search of all combinations of input parameters and selects only those that best meet the optimization criteria. In subsequent phases, the “optimal” combinations are crossed until the results stop improving. Thus, the number of combinations and the total optimization time are considerably reduced.

Single Trading Strategy for Multiple Symbols

Strategy Tester for Forex and other markets allows you not only to find best trading robot’s parameters for any specific financial instrument. Any strategy can be automatically tested on all symbols available in Market Watch at one pass by clicking “Start” button.

Obtained statistical test data on each symbol will be displayed as a table in “Optimization Results” tab. You will be able to launch a single testing of any symbol from the table by double clicking on it. Thus, this optimization mode allows you to quickly test all Market Watch symbols on one trading robot, determine the best results and analyze their change depending on a symbol.

 

The results of testing a trading robot on several financial instruments in the Strategy Tester
 

MQL5 Cloud Network

Distributed testing and optimization allow adding more computing power to these processes. For example, you can use computers in your local network and accelerate the optimization process by several times. But that is not all.

MQL5 Cloud Network is a cloud calculations network that unites thousands of computers from all over the world. The Strategy Tester can connect the network benefiting from its almost unlimited computing power. Thus, the optimization, which would take months if using only one computer, can now be run in a few hours.

 

Using the MQL5 Cloud Network for distributed calculations in the Strategy Tester
MQL5 Cloud Network can be enabled in MetaTrader 5 trading platform in two clicks. Learn more about how to speed up calculations with the MQL5 Cloud Network.In addition to using the distributed computing network, traders can provide their CPU computing power and earn money. To do this, launch MetaTester component included in MetaTrader 5 trading platform. It will connect your computer to MQL5 Cloud Network quickly and conveniently. 

Graphical Display of Optimization Results

The Strategy Tester provides powerful tools for visual analysis of optimization results that can be displayed in a chart, as well as in 2D and 3D.

For example, you can analyze a correlation of a final result with two parameters in 2D.

 

The results of testing represented in the 2D mode in the Strategy Tester
3D allows you to see the entire process of searching the best result during optimization. Example of searching for the function maximum using the math calculations mode in the Strategy Tester is shown below: 
The results of testing represented in the 3D mode in the Strategy Tester
In addition to the built-in features, traders can easily use custom visualization methods. There is no need to prepare data in some specific way, export and process it in a third-party application. Results can be displayed right during the optimization process. 
The features of using custom visualization methods for the optimization in the Strategy Tester
 

Built-In and Custom Optimization Criteria

What is the best set of parameters in each optimization case? Maximum profit can be used as the main criterion. However, it does not ensure objective evaluation of a trading robot in all cases. Analysis of complex indices can prove to be more efficient. The Strategy Tester offers many useful tools for that case providing 6 built-in optimization criteria considering balance, drawdown, profitability, etc. The main feature is the use of custom optimization criteria. Traders can implement any parameter into their Expert Advisor to test it in the Strategy Tester.

Forward Testing

The built-in forward testing helps avoid the insidious problem, which is usually called “over-optimization” or Expert Advisor parameter fitting. This option divides the quotes history base for optimization into two parts. The optimization is performed for the first part, while the second part is used to confirm the obtained results. If Expert Advisor is equally efficient on both segments, this is the proof that the robot has the best parameters and parameter fitting is practically impossible.

The Strategy Tester is an indispensable tool for developers of Expert Advisors. It is practically impossible to create an efficient and reliable trading robot without this exciting tool. The tester saves lots of time and allows creating a truly profitable Expert Advisor.