Discussing the article: "Creating a Trading Administrator Panel in MQL5 (Part IX): Code Organization (IV): Trade Management Panel class"

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Creating a Trading Administrator Panel in MQL5 (Part IX): Code Organization (IV): Trade Management Panel class.
This discussion covers the updated TradeManagementPanel in our New_Admin_Panel EA. The update enhances the panel by using built-in classes to offer a user-friendly trade management interface. It includes trading buttons for opening positions and controls for managing existing trades and pending orders. A key feature is the integrated risk management that allows setting stop loss and take profit values directly in the interface. This update improves code organization for large programs and simplifies access to order management tools, which are often complex in the terminal.
The primary goal of our articles is to make practical the use of MQL5 by applying it to various projects. Today, we will explore the development of a Trade Management Panel class, keeping in mind that, in MQL5, a class header contains declarations of similar variables. In this context, all the trading features we intend to include in our panel will inherit from built-in class headers such as CTrade, CDialog, CLabel, and CEdit.
Once the class is fully developed, we will integrate its methods into the main program—the NewAdminPanel EA. Our discussion wouldn’t be complete without sharing the test results and providing the source files, allowing you to review the implementation, borrow ideas, and experiment with the code to enhance your own projects.
At this stage, I decided to centralize the creation of the home panel within the main program, as it did not significantly increase the code length. Although the previous approach had its advantages, I opted for this structure to simplify development by reducing dependencies. My goal is to keep the main program focused while using a dedicated class for each specific feature. The core interface elements are now created directly within the main program, resulting in a more streamlined and efficient design. As a result, we are no longer calling the methods of the AdminHomeDialog class in NewAdminPanel.
The image below illustrates what we will create by the end of our discussion. But this is just the beginning—once it's built, it serves as a solid foundation for future enhancements and improvements.
Author: Clemence Benjamin