When using any tool in the real world, you feel more confident if you understand how that tool works. Application development is no different. When you understand how your development tools function, you feel more comfortable and confident using them. Your tool for making automated trading programs and indicators is MetaQuotes Language. The fact that you are reading this page means you have at least some idea about what MQL is. If you don’t, MQL is an object-oriented language for writing automated trading strategies called Expert Advisors, and custom technical indicators. These Expert Advisors and custom indicators can be used with any financial instrument on MetaTrader software.
MQL5 is the latest iteration of the MetaQuotes Language. Similar to its predecessor MQL4, its syntax is based on C++, which is a very powerful and popular programming language. As compared to MQL4, the new version now has support for enumerations, structures, classes, and event handling. There are also new built-in types, enabling you to write programs that communicate with other programs outside MetaTrader, through DLLs. As MQL5 is based on C++, prior knowledge of C++ can greatly decrease its learning curve. However, if you don’t have any C++ experience don’t worry as MQLCentral will walk you through the entire learning path. We will cover everything from language fundamentals to advanced techniques for developing Expert Advisors and custom indicators.
Before learning MQL syntax and its constructs, you should understand what kind of programs you can make with it. In general, there are three types of MQL5 programs you can create:
- Expert Advisors: EAs are trade automation programs you create and attach to a chart. They analyze the market data to modify and close trades based on conditions you define. At any point in time, there can be a maximum of one EA attached to a chart.
- Indicators: A technical indicator is a mathematical calculation based on historical price, volume, or open interest information that aims to forecast financial market direction. An indicator displays its analysis results on the associated chart using lines, histograms, arrows, and text objects. MetaTrader comes with many standard indicators built-in, but you can always develop your own indicators.
- Script: A script is a special program that performs a specific task. It is executed only once and then removed upon its termination or a change of state in its associated chart.