Back to courses
MQL5

MetaTrader 5 MQL5 for CFD Traders

Write indicators, Expert Advisors, and risk-managed automation — MQL5 from zero to a complete trading robot.

17 articlesBeginner → AdvancedUpdated 2026-09-14
4 parts
17 lessons · Beginner → Advanced

About this course

MQL5 is MetaTrader 5's C-style language. It is stricter and lower-level than PineScript, but it buys you something Pine cannot: full control over order execution, position management, and a built-in multi-threaded strategy tester. This course takes you from opening MetaEditor to shipping a complete trend-following Expert Advisor that sizes by risk, validates every order against the broker's own limits, and cleans up after itself. Along the way you will hit the CFD-specific traps that break most first robots — tick value versus point, minimum stop distance, filling modes, and swap.

What you'll be able to do

  • Write MQL5 indicators, scripts, and Expert Advisors from scratch
  • Place and manage orders correctly, including filling modes and stop validation
  • Size positions from tick value and contract size instead of guessing lots
  • Read a Strategy Tester report and spot an overfitted backtest
  • Build a multi-timeframe EA with proper handle cleanup

Prerequisites

  • MetaTrader 5 installed (any broker, demo account is fine) — MetaEditor ships with it
  • Basic chart reading: candles, support/resistance, moving averages
  • Part 1 assumes no prior coding, but MQL5 is stricter than Pine — expect to think about types

Learning path

4 parts · 17 lessons · every lesson ships with a complete MetaEditor program you can paste in and run.

Your progress

Progress is saved in this browser only. Nothing is sent to a server.

Part 1

MQL5 Foundations

Set up MetaEditor, learn the event model, and draw your first indicator on the chart.

5 done
Part 2

Logic and Reuse

Conditions, loops, functions, and the data structures MQL5 hands you.

4 done
Part 3

Expert Advisors

Send real orders, handle rejections, size by risk, and read a backtest honestly.

4 done
Part 4

Advanced Patterns

Indicator handles, multi-timeframe context, automation, and the complete EA.

4 done

Ready to run your first MetaEditor program?

Jump into lesson 1 — setting up the MetaEditor editor and writing your first program. No prior coding required.

Start lesson 1

Continue with another course

Pair this with execution