Discussing the article: "Creating a Trading Administrator Panel in MQL5 (Part XII): Integration of a Forex Values Calculator"

 

Check out the new article: Creating a Trading Administrator Panel in MQL5 (Part XII): Integration of a Forex Values Calculator.

Accurate calculation of key trading values is an indispensable part of every trader’s workflow. In this article, we will discuss, the integration of a powerful utility—the Forex Calculator—into the Trade Management Panel, further extending the functionality of our multi-panel Trading Administrator system. Efficiently determining risk, position size, and potential profit is essential when placing trades, and this new feature is designed to make that process faster and more intuitive within the panel. Join us as we explore the practical application of MQL5 in building advanced, trading panels.

Since we introduced modular design into this series, we've gained the ability to focus on individual sections of the program without disrupting other components. This flexibility now allows us to upgrade the Trade Management Panel to make space for the integration of calculation tools.

To achieve this, we'll leverage additional classes from the MQL5 Standard Library. Instead of maintaining separate input sections for each order type, we will implement a drop-down menu for order selection, accompanied by a single input row. This streamlined layout will free up space for our calculator components.

While not all trading values need to be displayed, certain key values are essential for informed decision-making and must be made available. Some of these values do not need to be calculated at all, as they are already accessible via live market data in MQL5.

We will begin with a detailed exploration of the key forex terms and values, including their definitions, formulas, and how they are represented within MQL5. From there, we’ll move into the implementation phase, starting with adjusting the Orders section of the Trade Management Panel to accommodate the calculator’s front-end interface.

ChangesComingtoTradeManagementPanel

Author: Clemence Benjamin

 
 

Hi Clemence,

Very Good article.  I downloaded it and revised the locations of the include files, compiled it and it worked!  In my preliminary evaluation, I found that the top vertical button when pressed and nothing else is on the chart, it does not completely hide the other buttons.  It looks like your xy position is off as the vertical sliver of the button still recognizes the click event. 

It also looks like you may have a spacing problem for for some texts.  However this could also be caused by my Win11 text size specification,


Attached file illustrates this problems.


Here's a suggestion to facilitate your downloads.  Create a subdirectory in the include directory and put all of your include files in it and adjust the #include statements to recognize the subdirectory, #include <AdminPanel\....>  This also helps downloaders to keep their include directory better organized.

Files:
EURUSDH4.png  52 kb
EURUSDH4_1.png  100 kb
 
CapeCoddah #:
 

Hi Clemence,

Very Good article.  I downloaded it and revised the locations of the include files, compiled it and it worked!  In my preliminary evaluation, I found that the top vertical button when pressed and nothing else is on the chart, it does not completely hide the other buttons.  It looks like your xy position is off as the vertical sliver of the button still recognizes the click event. 

It also looks like you may have a spacing problem for for some texts.  However this could also be caused by my Win11 text size specification,


Attached file illustrates this problems.


Here's a suggestion to facilitate your downloads.  Create a subdirectory in the include directory and put all of your include files in it and adjust the #include statements to recognize the subdirectory, #include <AdminPanel\....>  This also helps downloaders to keep their include directory better organized.

Thank you, @CapeCoddah, for your feedback and for suggesting a more organized subdirectory structure for files related to this project.

I’ll consider implementing it in future updates—it’s a great idea and will help prevent mixing files from different projects.

Regarding the text spacing, I think it's likely related to your operating system or some settings at your end, as everything appears properly aligned on my end. You can experiment with font sizes and x-axis spacing in the code to achieve the best visual result.

CapeCoddah
CapeCoddah
  • 2021.05.17
  • www.mql5.com
Trader's profile
 

Hello,

I was trying to install it but no button was showing, i can only see two checkboxes. I extracted the files into the Include folder as mentioned and the images were extracted into the images folder

 

Hi Clemence,

I'll check it out and let you know in a few days.

I am using !! AdminPanel as my subdirectory name.  the double "!!" get the subdirectory up to the top of the file explorer listing. Also when you update the version, you can copy the include ea directories and rename them with the version number, e.g. !! AdmnPanel - 1.13.  If you do this, then Terminal will have the original EA directory as well as the generational tagged one so you can easily go back to run the old version if needed.  I found this directive: #property version     _Version will add the _Version string number to the program name displayed on the input screen which helps in understanding which version you are looking for.  I also use Beyond Compare from Scooter Software, its awesome, to compare versions to each other

I'm also going to extract all of the supporting functions in the EA into a header file so I can incorporate your system into my ea as I appreciate all the excellent work you put into this project.  I also like your use of the controls classes; I will learn a lot evaluating your code.

Cheers,

CapeCoddah

 

Hi Again,

You may rue the day I downloaded your Admin EA, but here goes:

I have split out the unique code in the Ea into Admin Common.mqh and compiled it and it works.

However...

When I started playing around, the buttons from top to bottom work well with the exception the bottom button does nothing. but when I move one panel on top of another, the "join forces" and move together. This also occurs with all three panels.


Screen 1 is the program with sequentially pressing the buttons from top to bottom.  Note Bottom button does nothing

Screen 2 is overlaying the three panels.  If you try to move one, they all move.  The mouse move needs to distinguish which chart it should move.

Scren 3 illustrates one move moves all three

Screen 4 illustrates when one of the panel's x button(close) the program closes all and also terminates and removes itself

Screen 5 illustrates when you close the third panel using the X close button and the press the button to redisplay it, the background panel is not redrawn.


I've also included a zip file which contains the includes directory and have placed the !! AdminPanel source and executable in it for you/  In addition, I included my GoldBug common.  99% of it is probably useless but it contains DTS (Double to String)) as I got sick of typing the long name.  The DTSC versions have not been fully debugged.  I was planning on using them to insert commas for currency displays with or without the $.  Probably string format would be easier.


Cheerio!  Eat your Wheaties and happy programming


Cape CoddaH

Files:
 
CapeCoddah #:

Hi Again,

You may rue the day I downloaded your Admin EA, but here goes:

I have split out the unique code in the Ea into Admin Common.mqh and compiled it and it works.

However...

When I started playing around, the buttons from top to bottom work well with the exception the bottom button does nothing. but when I move one panel on top of another, the "join forces" and move together. This also occurs with all three panels.


Screen 1 is the program with sequentially pressing the buttons from top to bottom.  Note Bottom button does nothing

Screen 2 is overlaying the three panels.  If you try to move one, they all move.  The mouse move needs to distinguish which chart it should move.

Scren 3 illustrates one move moves all three

Screen 4 illustrates when one of the panel's x button(close) the program closes all and also terminates and removes itself

Screen 5 illustrates when you close the third panel using the X close button and the press the button to redisplay it, the background panel is not redrawn.


I've also included a zip file which contains the includes directory and have placed the !! AdminPanel source and executable in it for you/  In addition, I included my GoldBug common.  99% of it is probably useless but it contains DTS (Double to String)) as I got sick of typing the long name.  The DTSC versions have not been fully debugged.  I was planning on using them to insert commas for currency displays with or without the $.  Probably string format would be easier.


Cheerio!  Eat your Wheaties and happy programming


Cape CoddaH

Thank you  @CapeCoddah for all your feedback and the effort you’ve invested — it truly contributes toward a more stable version of this multipanel trading tool.

I really appreciate the time you're taking to explore and figure things out.

I'm currently reviewing the issues you've highlighted and will also be checking on the modifications you submitted. Improvements are on the way.

Best regards,

Clemence Benjamin

CapeCoddah
CapeCoddah
  • 2021.05.17
  • www.mql5.com
Trader's profile
 
Oluwafemi Olabisi #:

Hello,

I was trying to install it but no button was showing, i can only see two checkboxes. I extracted the files into the Include folder as mentioned and the images were extracted into the images folder

Hello @Oluwafemi Olabisi,

Could you kindly share a screenshot so I can assist you more effectively?

 
Clemence Benjamin #:

Hello @Oluwafemi Olabisi,

Could you kindly share a screenshot so I can assist you more effectively?

I have attached here, how the files were extracted into the INCLUDE and IMAGES directories respectively.
 

Hi Clemence,

I've got a few questions and perhaps  you can resolve some of them.

First is the Strategy tester

When I run my EA in it, none of the text, panels buttons etc are displayed on the testing machine.  I noticed that some of yours are displayed.  Do you have any idea what causes this difference?  Im planning on incorporating your ea into mine and trying to determine what causes the differences.

Second, How do you contact MetaQuotes to transmit bugs and suggestions for improvement to them.  I have spent considerable time in MQL5.com and cannot find a way.

 
Oluwafemi Olabisi #:
I have attached here, how the files were extracted into the INCLUDE and IMAGES directories respectively.

The ea should be in the experts folder not the include folder.  AFter you move it, you must stop the EA and restart it to get the EA to show up in the Navigator Pane.  Its one to the things MQ should change. At least allowing users to collapse the Folder, either Indicators or EXperts, and then refresh the list on during the expand command rather than stopping Terminal and restarting it and then opening all of the sub-directories until you reach your target.  Better yet they should do it automatically when ever a new executable is placed in the subdirectory.