Algorithmic Trading In MQL5: OOP & Advanced Techniques

The Algorithmic Trading In MQL5 advanced course will teach you how to code with object-oriented programming and some advanced techniques that many algo-traders use in their every-day trading, including your instructor.

The trading robots (expert advisors) are provided with the course.

You will learn:

  • How to code from an object-oriented programming approach

  • How to code classes and objects and implement them in an expert advisor

  • How to send, modify and cancel pending orders

  • How to use time to make the EA trade in specific hours or days
  • How to use volatility targets

  • How to manage position risk

  • How to connect your trading to a VPS
Algorithmic Trading In MQL5 Advanced Course Image

This course includes:

  • 6 hours
  • 1 article
  • 10 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of completion

MQL5 Advanced Course Description

In this course you will learn how to code with object-oriented programming and some advanced techniques that many algo-traders use in their every-day trading, namely: working with pending orders, trading with time ranges, setting volatility-based targets and manage position risk.

This course is structured in three parts.

Introduction To Object-Oriented Programming (OOP)

In the first part we will focus on how to code object-oriented programming in MQL5. We will cover the theory while maintaining a practical approach.

First, we will introduce you to object-oriented programming, covering classes and objects, and then we will explain most OOP basic concepts, such as encapsulation, inheritance or polymorphism, both in theory and code and with examples.

Rebuild Of The Expert Advisor With OOP

In the second part we will take the expert advisor that we built in the previous course, “Algorithmic Trading In MQL5: Code Robots & Free Up Your Time” and we will rebuild that robot with classes and objects of our own.

In case that you did not complete the previous course, you will have available for download a copy of that expert advisor in this course, so you can follow along with the lectures.

Advanced Techniques

In the third part we will add new-advanced features to our rebuilt expert advisor.

First, we will cover everything about pending orders and we will create a version of our robot that trades with them. Next, we will code a trading timer and make our expert trade only during the time specified. Following that, we will learn about volatility, different methods to calculate volatility, and we will implement and use volatility in our EA. Finally, we will learn about risk management and we will implement a technique to manage the risk we take in our positions.


  • Basic knowledge of the MQL5 programming language

Who is this course for:

  • Algorithmic traders that completed the course “Algorithmic Trading In MQL5: Code Robots & Free Up Your Time” and are willing to keep learning and improve their expert advisor
  • Any algorithmic trader that desires to expand their knowledge of MQL5
  • Any algo-trader interested in integrating any of the methods taught in this course into their trading robots

This is an intermediate level course. It is not appropriate for beginners as we will not cover the basics of the MQL5 language. Beginners should take instead “Algorithmic Trading In MQL5: Code Robots & Free Up Your Time”.

However, if you took the time to complete the previous course, or you have basic knowledge of MQL5, then you are ready to take this MQL5 advanced course.

MQL5 Advanced Course Content

1- Disclaimer

2- Welcome

3- Starting Point (i): Review at the Simple Moving Average Expert Advisor Strategy

4- Starting Point (ii): Review at the Simple Moving Average Expert Advisor Code

5- Starting Point (iii): How the Expert Advisor works in backtest

Part 1: Introduction To OOP

6- Part 1: OOP Fundamentals

7- Classes & Objects

8- Classes & Objects in MQL5: Car Class

9- Classes & Objects in MQL5: Car Object

10- Classes & Objects in MQL5: Indicator Examples

11- Class Methods

12- Constructors and Destructors

13- Encapsulation and Access Modifiers

14- Inheritance and Derived Classes (i)

15- Inheritance and Derived Classes (ii)

16- Polymorphism and Overloading

17- Polymorphism and Virtual Functions

Part 2: Rebuilding The Expert Advisor With OOP

18- Part 2: Rebuilding The EA With OOP

19- CTrade Class Declaration

20- Class Constructor

21- Request Variable Setters

22- A Single EA for Hedging and Netting Accounts

23- SelectPosition Method

24- Order Placement

25- Modification of Positions

26- Closing Trades

27- Implementation of CTrade Class to our Expert Advisor

28- CPM Class

29- AdjustStops, SL & TP

30- Trailing Stop Loss

31- Break Even

32- Implementation of CPM Class to our EA

33- CBar Class: Declaration and Methods

34- CBar Class: Bar Information Methods

35- Implementation of CBar to our EA

36- CIndicator Class

37- CIndicator Methods

38- CiMA Class

39- MA Signals

40- CiBands Class

41- CiBands Upper and Lower Bands

42- Implementation of CiMA to our EA

43- Testing the EA v2.0

44- MQL5 Library Classes

Part 3: Advanced Techniques

45- Part 3: Advanced Methods

46- Introduction To Pending Orders

47- Placement Of Pending Orders i

48- Placement Of Pending Orders ii

49- Modification Of Pending Orders

50- Expiration Time

51- Delete Pending Order

52- Get Tickets Of Pending Orders

53- Coding the Pending Order EA Version

54- Testing the Pending Order EA Version

55- Introduction to Trading Timer

56- Coding a Trading Timer

57- Implementing Trading Timer

58- Testing the Timer

59- Introduction to Volatility-based Targets

60- Coding Volatility

61- Implementing Volatility

62- Testing Volatility-based Targets

63- Introduction to Risk Management

64- Coding Risk-based Position Sizing

65- Verification Of Position Volume

66- Coding Risk Management

67- Implementing Risk-based Position Sizing

68- Testing Risk-based Position Sizing

69- Additional & Final Section

70- Market Closed Tester Error

71- Market Closed Tester Error Solution

72- About VPS (i)

73- About VPS (ii)

74- Course Conclusion

Bring Your Algorithmic Trading To The Next Level

Upgrade Your Trading

What Our Students Say On Udemy

Some kind words from our amazing students

I recently completed Jose’s ‘Algorithmic Trading In MQL5: OOP & Advanced Techniques’ course, and it was truly an eye-opening experience. The course was extremely well-structured, and the instruction was excellent. The instructor was highly knowledgeable and passionate about the subject matter, and he did an excellent job of breaking down complex concepts and making them easy to understand. All his chapters were very straight-forward to follow and ‘code-along’ and his explanations were thorough and informative. Having gone through his first course I was eagerly awaiting this one. I particularly appreciated the focus on Object-Oriented Programming, as it allowed me to apply the concepts I had learnt in the first course to real-world algorithmic trading scenarios. I felt like I was able to make significant progress in my understanding of the material. I really appreciated how by the end of the course you pretty much have a working framework that you can improve upon. Overall, I would highly recommend this course to anyone interested in improving their MQL5 Algo Trading skills to a much more advanced level.

Herman M

Great course to participate in. You’ll learn everything you need to implement your trading strategy in MQL5.

Pavel Zahradka

Excellent course, now waiting for even more advanced course about multi currency EA and possible multi strategies.

Darko Karamarko