MQL5 & MetaTrader core
MetaTrader 4 vs MetaTrader 5
3 min
MetaTrader, by MetaQuotes, is the most widely used retail trading platform, and its scripting language is the most common way retail traders automate strategies.
The two versions
- MetaTrader 4 (MT4) — released 2005, built around forex and CFDs. Programmed in MQL4. Still enormously popular thanks to a vast library of existing robots and indicators, and the inertia of brokers and traders who never moved on.
- MetaTrader 5 (MT5) — the successor. Multi-asset (forex, stocks, futures), more timeframes, an economic calendar, depth of market, and a far more capable Strategy Tester (multi-currency, real-tick, multi-threaded optimization). Programmed in MQL5.
MQL4 vs MQL5
The languages are C-like and similar in spirit but not compatible. MQL5 is more object-oriented, handles a netting/hedging position model explicitly, and uses a cleaner trade API. Code does not port between them without changes.
Which to learn
For new work, learn MQL5 on MT5. It is the platform MetaQuotes actively develops, its tester is dramatically better for honest backtesting (the focus of the next chapter), and it covers more asset classes. We use MQL5 throughout this track. The concepts — event functions, order placement, the tester — carry over to MQL4 if a broker forces you onto MT4.
This content is for educational and informational purposes only and is not investment, financial, tax or legal advice. Trading and investing carry risk, including the possible loss of capital. Any performance shown by third-party tools is hypothetical and not a promise of future results. Do your own research and consider professional advice before making any decision.