
Explore the basics of object oriented programming by comparing structures and classes, including converting a param struct to a param class and using public members.
Explore class members and the data they store, including primitive types, arrays, structures, and other class instances, while noting that a class cannot contain a member of itself.
Explore class methods in the param class, with getter and setter patterns for enum members, and see how instances remain independent while methods require an instance to be invoked.
Explore encapsulation in object-oriented programming and how public, private, and protected access control shapes modularity. Learn when to use getters and setters to manage class members and maintain code integrity.
Explore dynamic memory allocation for class objects, compare it with automatic allocation, and learn how pointers with new and delete control runtime object lifecycles.
Explore class method overloading, including default and parametric constructors, and see how multiple constructors initialize class members during object instantiation.
Explore inheritance in object oriented programming by deriving trader and stock trader from a base person class to reuse features, while noting mql5 supports single but not multiple inheritance.
Master inheritance and encapsulation by examining base and derived classes, public/private/protected inheritance, and how least privileges govern which members are inherited or hidden in Mql5.
Learn virtual methods and abstract classes in MQL5, illustrating how virtual dispatch calls the actual class method via base class pointers and how pure virtuals create abstract classes.
Learn check pointer and get pointer in mql5 o o p, determine pointer types (invalid, automatic, dynamic), and safely manage class objects with new and delete.
Learn the const qualifier to prevent changes to class method arguments and class members in mql5, shown in constructors and get indicator data, with compiler errors guiding immutability.
Create an object-oriented expert advisor in Mql5 by cloning a template, wiring money management and signal classes, configuring a simple moving average strategy, and testing in the strategy tester.
Extend the expert advisor class with a reverse strategy by deriving a new class, overriding signal entry, and testing reversed buy/sell signals in strategy tester.
Here, we will begin to cover some of the aspects of the MQL5 standard library that are most useful to expert advisor development. Using the standard library requires knowledge of OOP, which was covered previously in this course.
Explain the C array base class and its derived types—C array int, double, and obj—and how to add and get items using total and ath methods.
We have covered the basic class objects needed to further proceed with expert advisor development using the MQL5 Standard Library.
In this section, we will cover the class objects used to access miscellaneous trading information using the classes from the MQL5 Standard Library.
Explore the CAccountInfo class in MQL5 to access account information with a unified, object-oriented approach. Initialize a CAccountInfo instance to print the current account's login, balance, and equity.
Explain how the c terminal info class offers an object oriented way to access terminal information, initialize an instance, and print the terminal path, mirroring the c account info example.
Select a symbol with the see symbol info class, then refresh data (including tick data) to access data such as bid and ask prices.
In this section, we have learned the class objects used to access miscellaneous trading information using the classes from the MQL5 Standard Library, which simply serve as alternatives to what we already know.
In this section, we will learn to dive deeper into the MQL5 Standard Library by learning to access the properties of orders, deals, and positions.
Explore the See Order Info class to understand order states, selection by index or ticket, and accessing properties such as stop loss, take profit, and initial and current volumes.
Use the CPositionInfo class to access position properties and select a position by index, ticket, magic, or instrument name, stop loss and take profit, considering netting and hedging modes.
In this section, we have learned to how to use the MQL5 Standard Library to access the properties of orders, deals, and positions.
This is just a small section about CTrade, which is a class object from the MQL5 Standard Library, used to place orders on the market.
In this section, we learned about CTrade. In future sections, we will learn about CExpertTrade, which inherits from the former, that further streamlines the process of trading for our expert advisors.
In this section, we will learn about how to access chart data using the MQL5 Standard Library.
Explore C price series and its derived classes in MQL5, using Sipri's series for open, high, low, and close prices, with a 1024 buffer and create, refresh, and getdata workflows.
Explore the CIndicator base class, its CMA-derived indicators, and how to create, refresh, and retrieve data handles while managing memory and using include directives.
In this section, we have learned how to access chart data using the MQL5 Standard Library.
In this section, we will learn the top-level components that comprise an expert advisor, using the MQL5 Standard Library.
Explore see expert base, base for expert advisors and components, focusing on init and validation settings that configure symbol, time frame, every tick processing, and magic number, with boolean termination.
Explore the key expert signal class and its general signals. See how m_direction and m_threshold_open determine buy, sell, or no signal through long and short conditions weighted by m_weight.
Learn how filters are organized inside a C expert signal, stored in the M filters array, and how bottom-to-top evaluation and the open threshold produce the final direction.
Explore the expert money base class and its derived money management methods: fixed lot, fixed risk, fixed margin, and money none, and how to use check open long or short.
Discover how the CExpertTrade class streamlines expert advisor trades by using a pre-initialized CSymbolInfo object, enabling buy or sell operations with automatic order type selection and simplified parameters.
Explore the sea expert trailing hierarchy in mql5, including fixed pips, ma, and parabolic sar trailing stops; learn initialization, indicator setup, and validation steps for OnInit and OnTick.
In this section, we have learn the top-level components that comprise an expert advisor, using the MQL5 Standard Library. In the next section, we will learn how to put these all together using walkthrough videos.
Now would be the time to apply everything we have learned about the MQL5 Standard Library when it comes to developing expert advisors. Code with me as I walk you through the entire process.
Create a CE expert signal instance to house all the filters for the expert advisor. Pass this signal to the init signal method to finalize the setup.
Configure six external parameters for the expert advisor, including threshold open, threshold close, price level, stop loss, take profit, and exploration, to control signal firing and pending order behavior.
This walkthrough demonstrates how to add a CExpertSignal filter to an MQL5 expert advisor by selecting signal AC, creating a dynamic instance, checking for success, and assigning a weight.
Add a money management class instance to your expert advisor by including the fixed risk module, creating and verifying the instance, and linking it with the expert's init flow.
Test the expert advisor, fix compiler warnings, rename variables, and resolve duplicates to ensure a clean compile. Then run the strategy tester, adjust period settings, and review trading results.
Generate an expert advisor with the expert advisor generator, configure name, symbol, time frame, and accelerator signal, and compile parabolic SAR 0.02/0.2 to test the generated expert advisor.
Now, you already have the knowledge and skills to start building your own expert advisors, using either OOP or the Standard Library, whichever methods suits you best. Good luck!
This course has everything you need to get the most in algorithmic trading, and with less code.
This course was designed with the trader in mind:
Low information diet - take only what you need to move on to the next section or lesson
Learn the rules of trading which you may use as well to enhance your own manual trading
Develop MQL5 programming skills and learn to apply to solve common problems in both manual and automated trading
This course takes the programming skills of traders to the next level. It allows one to code expert advisors with even lesser lines of code, through object-oriented programming. Less time coding, more time for learning and trading.
By the end of this course, students would be able to code expert advisors from a higher level of abstraction than what procedural programming can possibly offer. Through the use of class files, one would be able to create a new expert advisor with just several lines of code. One will no longer have to build everything from scratch--build complex expert advisors with less code.
This is programming course is aimed at making the life of the trader easier by enabling one to develop his or her own MQL5 programs, and augment his or her trading skills through automation. It also allows the trader to execute trading rules and tasks that can be cumbersome or time-consuming when executed manually.