MQL4 is a built-in programming language by MetaQuotes Ltd. for creating automated trading systems (Expert Advisors), custom technical indicators, scripts, and libraries. It is designed for online trading platforms.

**Program Types:**

  • **Expert Advisor (EA):** Mechanical trading system linked to a chart. Executes on events: initialization, deinitialization, new tick, timer, depth of market change, chart event, custom events. Can automate trading by sending orders to a trade server. Stored in MQL4\Experts.
  • **Custom Indicator:** Independent technical indicator for analytical functions only. Cannot trade automatically. Stored in MQL4\Indicators.
  • **Script:** Program for single execution of actions. Executes only the start event (OnStart handler). Stored in MQL4\Scripts.
  • **Library:** Set of custom functions for reuse. Cannot execute independently. Stored in MQL4\Libraries.
  • **Include File:** Source text of frequently used code blocks. Can be included in EAs, indicators, scripts, and libraries during compilation. Preferred over libraries for performance. Stored in MQL4\Include or locally using #include with angle brackets or double quotes respectively.
  • **Development:**

  • Uses MetaEditor, a text editor with MQL4 syntax highlighting.
  • **Key Features:**

  • Analyzes current and historical quote data.
  • Includes built-in basic indicators.
  • Provides functions for managing trade orders.
  • **Documentation Resources:**

  • MQL4 Reference sections cover language basics, constants, enumerations, structures, program types, predefined variables, common, array, conversion, math, string, date/time, account, market info, timeseries, chart, trade, signal, global variables, file, custom indicator, object, technical indicator, event, and obsolete functions.
  • Provides indices for MQL4 functions and constants.
  • MQL4 Help available as a downloadable CHM file (English, Russian).
  • **Platform:**

  • Developed by MetaQuotes Ltd. for their online trading platforms.
  • **Related:**

  • MQL5 features available.