Lesson 1: What is MQL5? Expert Advisor vs Custom Indicators vs Script
MQL5 has been developed by MetaQuotes Software Corp. for their trading platform. The language syntax is very close to C++ enabling programmers to develop applications in the object-oriented programming (OOP) style.
The MQL5 language provides specialized trading functions and predefined event handlers to help programmers develop Expert Advisors (EAs), which automatically control trading processes following specific trading rules. In addition to EAs, MQL5 allows developing custom technical indicators, scripts and libraries.
This MQL5 language reference contains functions, operations, reserved words and other language constructions divided into categories. The reference also provides descriptions of Standard Library classes used for developing trading strategies, control panels, custom graphics and enabling file access.
Types of MQL5 Applications
- Expert Advisor is an automated trading system linked to a chart.
An Expert Advisor contains event handlers to manage predefined events which activate execution of appropriate trading strategy elements.
For example, an event of program initialization and deinitializtion, new ticks, timer events, changes in the Depth of Market, chart and custom events.
- Custom Indicators is a technical indicator developed by a user in addition to standard indicators integrated into the trading platform.
Custom indicators can utilize values of other indicators for calculations, and can be called from Expert Advisors.
- Script is a program for a single execution of an action.
- Service is a program that, unlike indicators, Expert Advisors and scripts, does not require to be bound to a chart to work.
To launch a service, its code should contain the OnStart handler function. Services do not accept any other events except Start, but they are able to send custom events to charts using EventChartCustom.
- Library is a set of custom functions. Libraries are intended to store and distribute commonly used algorithms of custom programs.
- Include File is a source text of the most frequently used blocks of custom programs. Such files can be included into the source texts of Expert Advisors, scripts, custom indicators, and libraries at the compiling stage.
The use of included files is more preferable than the use of libraries because of additional burden occurring at calling library functions.
Include files can be stored in the same directory where the original file is located. In this case the #include directive with double quotes is used.
Post a Comment