THE CHART MECHANICSTools & Education
Course · coding

TCM MQL4 & MQL5 Coding Course

A practical course in writing MetaTrader 4 and MetaTrader 5 programs: the event model, data and indicators, trade requests and their results, symbol rules, state, logging, testing and migration, ending with a complete, commented Expert Advisor in both languages.

  • 15 modules
  • 148-page PDF
  • MQL4 + MQL5 side by side
  • Capstone EA source included
Module 9: volume normalisation code with MQL4 and MQL5 tabs
Syllabus

What's in the 15 modules

Four parts, from setting up MetaEditor to delivering a finished EA. Every code example comes in MQL4 and MQL5 with a tab to switch between them, and the capstone LearningEA source files (.mq4 and .mq5) are yours to study and change. Checked against the MetaQuotes documentation in October 2026.

Want it built for you instead?If you'd rather have your strategy coded than learn to code it, see custom builds.
Getting startedModules 01–03
  1. 01Foundations and setup
  2. 02Program structure and events
  3. 03Types, variables and scope
Core languageModules 04–07
  1. 04Conditions, loops and functions
  2. 05Price data, bars and time series
  3. 06Inputs and robust configuration
  4. 07Indicators and signal design
Trading operationsModules 08–11
  1. 08Trade requests and execution
  2. 09Position sizing and symbol constraints
  3. 10Stops, targets and price normalisation
  4. 11State, duplicate prevention and bar timing
Quality and deliveryModules 12–15
  1. 12Errors, logs and defensive coding
  2. 13Testing, debugging and reproducibility
  3. 14MT4 and MT5 differences and migration
  4. 15Capstone: build, document and deliver
Try a module

A tool from Module 10

The stop validator checks a stop-loss and take-profit against the broker's stops level, measured from the right side of the spread, exactly as the course's code does.

Knowledge check

Three questions from Module 10

Each module ends with six questions like these. Every answer comes with the reason, so a wrong answer still teaches you something.

Pick an answer to see how the knowledge checks work.

1. A buy at 1.08500 has a stop-loss at 1.08550. Should the validator accept it?

2. From which price is a buy's stop distance measured?

3. Tick size 0.25. What does NormalizeToTick(5250.37) return?

Good for
  • MetaTrader users who want to automate their own rules
  • Coders moving between MQL4 and MQL5
  • Anyone who has bought an EA and wants to read and judge code properly
Not for
  • Anyone looking for a profitable EA to copy. The capstone shows how to build an EA safely, not a strategy to trade.
  • Other platforms: the course covers MetaTrader only