MetaQuotes Language (MQL) is a programming language used exclusively with MetaTrader Software to create automated trading robots and financial market indicators. Programmers who write MQL scripts must have a strong grasp of object-oriented programming, MQL syntax, and the financial markets in which they plan to deploy MQL scripts.
The goal of writing MQL scripts is to automate the process of analyzing financial markets, primarily foreign currency exchange markets (Forex), and trading financial instruments based on that analysis.
The first version of MQL was released in 2001 as an integrated programming language in the MetaQuotes trading platform. In 2002, an updated and rebranded version of the MetaQuotes platform was released, named MetaTrader, and packaged up with MQL II which was an updated version of the MetaQuotes programming language.
MQL, as it is known and used today, was released on July 1, 2005 along with MetaTrader 4 (MT4). The new language was called MQL4. The platform and integrated programming language were a hit and rapidly became the de facto standard-bearing trading platform within the forex trading marketplace.
In 2010, MetaTrader 5 (MT5) was released along with MQL5, and was MetaQuotes Software’s first attempt to branch out beyond the forex market. The software was a modest success, but was not able to supplant MT4’s position as the market leader.
Today, MT4 and MQL4 programming are still used extensively to automate the analysis and trading of forex financial instruments. MT5 is also used within forex markets, but can also be used to program and facilitate the trade of other instruments such as stocks, bonds, and commodities. As of 2011, more than 450 brokerage companies and banks had deployed MetaTrader platforms for trading in forex and other financial instruments.
MQL is an object-oriented programming language with syntax based on the C programming language. As a result, programmers who already know C, or closely related languages such as Java or C++, will find MQL syntax familiar, and pick up the language quickly.
In 2014, MetaTrader 4 600 Build was released. This new version of MetaTrader 4 significantly expanded the capabilities of MQL4 to the point that performance of the programming language is now much closer to the performance of MQL5. While MQL4 and MQL5 are similar, MQL5 includes many functions and features that MQL4 does not. In addition, some of the fundamental ways that processes are handled vary between the languages. As a result, while scripts can be ported between MQL4 and MQL5, extensive rewriting is often required.
For this reason, when learning MQL, it’s important that programmers focus on the language applicable to the trading platform they will be using. MQL scripts can only be deployed on the MetaTrader platform. Before selecting MQL4 or MQL5, programmers should confirm which version of the MetaTrader platform their broker offers, MT4 or MT5, and learn the applicable language based on the platform they will be using.