MQL4 Programming for Traders: Build Robust Trading Robots!

The Ultimate Algo Trading Course - experience trading zen by learning how to code your own expert advisors and scripts.
4.1 (17 ratings)
Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
1,159 students enrolled
Instructed by Enrico Lambino Business / Finance
$19
$195
90% off
Take This Course
  • Lectures 74
  • Length 7 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 2/2016 English

Course Description

Become an MQL4 Programmer!

If you are a trader looking for ways to make trading simpler and more efficient, you've come to the right place. Leverage technology to your advantage!

If you are a trader-programmer who would like to bring your programming and algorithmic trading skills to the next level, this course is for you. No need to reinvent the wheel!

If you are somebody just looking for a new hobby, try algorithmic trading through this course. There are only so many hobbies where you are compensated for doing something great!

This course is the most intensive, yet straightforward, course for the MQL4 programming language - based on years of experience of an MQL4 programmer.

Probably the fastest way to learn how to build complex trading robots and scripts using the MQL4 programming language, for beginners, non-programmers, and traders!

The course is designed, with the beginner in mind:

  • Low information diet - take only what you need to move on to the next lesson
  • Learn the rules of trading, which you may use as well to enhance your own manual trading
  • Develop MQL4 programming skills, and learn to apply to solve common problems in both manual and automated trading

By the end of this course, students would be able to independently develop robust and efficient trading robots and scripts based on their own ideas, and expand on their programming knowledge on their own, as an MQL4 programmer!

What are the requirements?

  • Basic computer skills
  • A computer with internet connection
  • Metatrader 4
  • Windows-based operating system, or a Linux-based system to run the trading platform via Wine (Linux/Mac) or CrossOver (Mac)

What am I going to get from this course?

  • Learn more about the markets faster by learning how to develop and test trading systems based on your own ideas!
  • Create 60+ MQL4 scripts and 15+ expert advisors!
  • Code expert advisors and scripts for oneself and others!
  • Learn how to automate the various aspects of trading that may be hard to setup manually - from simple trading tasks to entire trading strategies!
  • Learn core concepts in programming that are also shared with other programming languages (C++, Java, Javascript, etc.)!

What is the target audience?

  • Traders who have little or no experience in programming
  • Programmers who want to get started on trading
  • Beginning traders who would like to learn more about trading by developing trading robots and scripts
  • Novice MQL4 programmers (up to intermediate level) who want to hone their skills!
  • This course is probably not for you if you are looking for more advanced programming approaches (object-oriented programming, deep learning, etc.)

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction
07:23

A short introduction on algorithmic trading and trading robots.

1 page

A quick guide on how to enable automated trading on MetaTrader.

08:06

Discover an alternative way of describing processes than simply writing down all the details in text. It is useful when describing complex processes that can be seen in scripts and trading robots.

08:28

This lesson discusses the basic structure of an expert advisor.

3 questions

Test your knowledge about expert advisors, scripts, and algorithmic trading (in general).

Section 2: Phase One: Knowing the Rules
Article

In this phase, we will learn some of the basics of programming and trading, and how to develop simple trading robots and scripts, based on them.

Logging Data
6 pages
04:25

Here, we will learn one of the most simple expert advisors we can create using MQL4 - a hello world application.

02:14

Learn how to code the script version of the hello world expert advisor.

Quiz: Expert Advisors and Scripts
5 questions
09:30

Learn about the basic data types in MQL4 that are used to store information.

06:39

Learn about the scope of variables and code blocks in MQL4 programs.

Quiz: Variables and Code Blocks
4 questions
11:50

Learn about functions and how they are defined and used in MQL4 programs.

Quiz: Functions
3 questions
08:19

Learn about the various types of orders that can be entered, as well as some of their characteristics.

3 questions

A short quiz on order characteristics.

3 pages

Learn about predefined variables and how to use them in MQL4 programs.

2 pages

Learn the different types of trade operations in Metatrader and MQL4.

07:38

Learn how trading robots and scripts enter trades on the market using the OrderSend function.

03:02

This video demonstrates the use of the OrderSend function in a script in order to enter a buy market order.

03:15

Learn how trading robots and scripts closes orders on the market using the OrderClose function.

02:30

This video demonstrates the use of the OrderClose function in order to close a specific order on the market, given the ticket ID of that order.

Quiz: Sending and Closing Orders
3 questions
04:55

Learn about arrays in MQL4, and how they are declared and used in MQL4 programs.

02:12

Learn about time series, a special type of array, which are used in almost any trading robot.

06:16

Learn how to access basic information on the chart (open, high, low, close, and open time of a chart bar).

4 pages

Learn about the various types of indicators that are used in Metatrader.

06:04

Learn about some of the indicator parameters that can often be seen in indicators.

02:06

Learn about line indicators, and how expert advisors and scripts can access their output.

07:00

Learn about the if-statement, which is the simplest type of condition statement.

03:48

Learn how to group multiple conditions in a single if-statement.

05:33

Learn about the if-else statement.

Quiz: Condition Statements
3 questions
07:37

Learn about the three types of variables in MQL4 that have global scope - the global variables, the external parameters, and the input parameters.

09:39

In this video, we will develop a simple trading robot based on what we learned so far about MQL4 programming.

Article

Congratulations to completing phase one of the course!

Here, we have learned the basics of programming and trading. Our next phases will deal mostly in making our programming easier and more effective, as well as expanding on our knowledge little by little.

Section 3: Phase Two: Defying the Rules
Introduction to Phase Two
Article
Accessing the Documentation
Article
13:31

This video gives an overview about errors, and how trading robots and scripts can learn about them. It also discusses the most common errors found in trading robots and scripts.

10:16

Learn about loops and how they are used in trading robots and scripts.

17:26

An in-depth lesson about the management of the entry of orders on the end of a trading robot or script. At the end of the lesson, students would be able to learn about the common pitfalls and preconditions when it comes to sending orders, and how to avoid them.

3 questions

A short quiz about the recent entry management lesson

04:05

Learn about data conversion and typecasting. At the end of this lesson, students would be able to learn how to convert data from one type to another.

03:48

This video demonstrates the use of the entry and send_order functions defined in the recent entry management lesson to upgrade the buy order script that was developed earlier in the course.

09:25

Learn about order selection, and how trading robots and scripts can be configured to get the information regarding a specific order.

2 questions

A short quiz about selecting orders.

04:05

This video demonstrates the use of loops and order selection to close all active market orders on the platform.

08:44

An in-depth lesson about the various preconditions involved when closing an order. At the end of this lesson, students would be able to learn the most common errors that can occur when closing an order, and how to avoid those errors from occurring.

02:43

This video demonstrates the knowledge gained from the recent exit management lesson to develop a script that closes all active orders on the trading platform.

2 questions

A short quiz on the recent exit management lesson.

04:50

Learn about pass-by-reference, an alternative way of passing arguments to functions. At the end of this lesson, students would be able to know how to pass huge data more efficiently, or simply allow a local variable to be modified in a function beyond their scope.

1 question

A short quiz on the concept of pass-by-reference.

03:02

Learn about the methods used in comparing data of double type. At the end of this lesson, students will learn a more efficient way to compare numbers with fractional components.

12:16

Learn about order modification. At the end of this lesson, students will learn how trading robots and scripts modify one or more properties of an existing order.

2 questions

A short quiz about modifying orders.

08:16

Learn about constants and enumerations. At the end of this lesson, students will learn alternative ways to store data as encoded on an MQL4 program source code.

04:14

Learn about switch statements. At the end of this lesson, students will learn a more efficient alternative to if-else statements (certain limitations apply).

03:35

An extension of the first exit management lesson. In this lesson, students will learn a more efficient exit function that would be able to close a greater variety of orders.

02:31

In this video, we will apply what we have learned in the recent exit management method to update our previous "close all" script.

04:18

Learn an alternative way of counting orders. In this lesson, students will learn how to count the number of orders based on certain criteria.

15:24

An in-depth lesson on money management. At the end of this lesson, students will discover the most common money management strategies, and how to implement them in trading robots and scripts.

05:20

An extension to the first entry management lesson. At the end of the lesson, students will learn how market execution works and how to code trading robots and scripts that would be able to work seamlessly with brokers that implement market execution.

11:38

An in-depth lesson about signal management. At the end of this lesson, students will learn an efficient way to handle entry and exit signals in a trading robot.

10:42

An in-depth lesson about the break even level. At the end of this lesson, students will learn how breaking even an order works and how to implement them in trading robots and scripts.

08:49

An in-depth lesson about trailing stops. At the end of this lesson, students will learn the various pitfalls and preconditions of implementing a trailing stop loss on orders, and how to deal with them.

02:52

Learn about static variables. At the end of this lesson, students would be able to learn how to make a local variable retain its value from one function call to another.

09:33

An in-depth lesson about detecting the presence of a new bar on the chart.

08:57

An in-depth lesson about implementing a time filter. At the end of this lesson, students would be able to learn a method of determining whether or not a certain time is within a given time range.

03:27

An extension of the first signal management lesson. At the end of this lesson, students will learn one method of resolving conflicts that may arise from entry and exit signals.

04:34

Learn about virtual stop levels. At the end of this lesson, students will learn about a method of hiding the stop loss and take profit of an order from the broker.

Article

The trading robot template that was used in the simple trading robot upgrade. This template will also be used all throughout the third phase of the course.

Article

This video demonstrates the use concepts learned in this phase of the course, in order to upgrade the first trading robot developed in this course.

Article

Congratulations to completing the second phase of the course!

We have now successfully generated a trading robot template that takes care of up to 99% of the source code when developing trading robots. From now on, most trading robots that we will make will take about around 20 additional lines of code or even less (using the trading robot template). With sufficient experience, you may reach a point where it is already possible to build a trading robot in 5 minutes or even less!

The lessons in this part of the course are pretty intense. Feel free to revisit any lesson within this phase. It is not expected for students to fully understand every lesson within this phase within a very short time frame.

With the trading robot template, you can now develop your own trading robots using mostly the knowledge gained under the first phase of the course. Learning programming takes time and experience, but with our trading robot template, doing so will not slow us down in developing robust trading robots and scripts.

Section 4: Phase Three: Making the Rules Work for You
Article

Welcome to the third phase of the course!

If you reached this far, most of difficult lessons in this course are probably over for you! This phase will focus more on the very reason why you took this course - developing trading robots. Here, we will apply what we have learned on all the previous lessons in order to build robust trading robots, along with some finishing touches.

03:22

Learn how a trading robot (or script) can be configured to detect a crossover between two chart outputs.

05:20

This video is a demonstration of crossover detection in order develop a trading robot that trades based on moving average crossovers.

02:32

Learn about histogram indicators.

04:59

This video is a demonstration of developing a trading robot based on the output of the awesome oscillator, a histogram indicator.

02:49

Learn about indicators with multiple chart outputs, and how to configure a trading robot or script to access their values.

06:58
This video is a demonstration of developing a trading robot based on the output of the MACD oscillator, an example of an indicator that give multiple outputs on the chart.
03:15

Learn about arrow indicators, and how trading robots and scripts can be configured to access their values.

06:27
This video is a demonstration of developing a trading robot based on the output of the fractals indicator, an arrow indicator.
04:18

Learn about custom indicators, and how trading robots and scripts can be configured to access their values through the use of the iCustom function.

06:44
This video is a demonstration of developing a trading robot based on the output of the zigzag indicator, a custom indicator.
Conclusion to Phase Three
Article

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Enrico Lambino, Trader, Programmer, Technical Writer

Enrico Lambino is self-directed learning enthusiast, programmer and technical writer. He has over 6 years experience in developing expert advisors, scripts, and custom indicators, mostly for the Metatrader 4 trading platform. He believes in the potential of programming in enhancing the performance of traders, making their tasks simpler and more efficient.


Ready to start learning?
Take This Course