MQL4 Book  MQL5 features

New MQL5 language features


The current version of the trading platform is most well-known among traders thanks to its user-friendly interface, a variety of technical analysis tools and the integrated MQL4 language. In the fourth version, MQL4 received the С language syntax allowing users to develop professional-level algorithmic trading programs. At the same time, transition to the new language did not require much effort from traders allowing MQL4 to gain world leadership in terms of the amount of developed indicators and trading robots.

Let us congratulate you on your excellent choice and offer you a brief tour on the MQL5 fifth generation language:

  • Manage price charts directly from an MQL5 program — adjust colors, develop control panels, display custom symbols and move charts beyond the terminal.
  • Try indicators featuring 12 new drawing styles, 512 buffers and direct calculation of values with indexation from past to future.
  • Debug Expert Advisors not only on charts but also in the multi-currency tester. Now the tester's trading logic matches that of online trading allowing you to test a combined strategy on all the necessary currency pairs simultaneously in one pass.

High speed of MQL5 language

The MQL5 execution speed is comparable to that of С++ applications, while MQL5 programs work up to 20 times faster than MQL4 ones. This is proved by the execution results of standard tests on MQL4, MQL5 and C++. The lower the bar, the less time (in milliseconds) spent on execution and the better the result. The tests have been conducted on Windows 10 (build 17763) x64, Xeon E5-2630 v4 @ 2.20GHz, Memory: 65457 Mb.

MQL5 vs MQL4 vs C++ speed comparison

The new asynchronous trading operations provide you with algorithmic trading features that were previously available only to a handful of professional traders. If you develop MQL5 robots, you do not need third-party connections to exchange protocols. Besides, you do not need to place your terminals as close to a broker as possible. Simply rent a built-in VPS and send your EA to trade there directly from the terminal. Low network costs, high Depth of Market refresh rates and asynchronous order sending accelerate trading operations dozens of times. Such acceleration can be a key factor in intraday trading.

Event-based trading robots

The MQL5 language has become completely event-driven. The entire trading logic can now entirely be based on handling incoming events. The OnTick() handler allows you to analyze the tick flow for any symbol, receive an entry signal and send an asynchronous trading request. After a fraction of a millisecond, the program execution continues, and you are ready to conduct a deal on another symbol. You waste no time waiting for the operation result since data on trading operations are received and handled in another handler — OnTradeTransaction(). This allows you to write trading algorithms with maximum reliability and efficiency.

Events are used not only for trading, but also for other tasks:

  • receiving the Depth of Market updates, analyzing price/volume changes in trade requests and trading based on analysis results;
  • creating auxiliary analytical tools and control panels for MQL5 programs;
  • managing optimization and visualization of obtained data in real time.

Testing multi-currency EAs

MQL5 allows you not only to develop EAs that trade on multiple symbols simultaneously, but also to test them in the strategy tester. The Sleep() function, timer events and special events for working in the optimization mode are handled correctly while working in the tester. EAs can be debugged and profiled in visual mode.

multiassets_tester

Explore MQL5 language features and develop game-changing algorithmic trading programs!