Discussing the article: "Improve Your Trading Charts With Interactive GUI's in MQL5 (Part III): Simple Movable Trading GUI"

 

Check out the new article: Improve Your Trading Charts With Interactive GUI's in MQL5 (Part III): Simple Movable Trading GUI.

Join us in Part III of the "Improve Your Trading Charts With Interactive GUIs in MQL5" series as we explore the integration of interactive GUIs into movable trading dashboards in MQL5. This article builds on the foundations set in Parts I and II, guiding readers to transform static trading dashboards into dynamic, movable ones.

Hello and welcome back to part 3 of our series "Improve Your Trading Charts With Interactive GUI's in MQL5".

Before we venture into new territory, let's quickly recap what we've covered in Parts I and II:

1. In Part I, we started by understanding the concept of chart events, and from there, we created two simple movable dashboards on the same chart.

2. For Part II, we took a step further. We utilized classes within a .mqh file to make our code more efficient and versatile, ready for integration with full-scale EAs/Indicators.


And now, we are ready for Part III! In this part, we're going to focus on enhancing our dashboards by integrating GUIs into them. Because without GUIs, dashboards won't serve their intended purpose.

Author: Kailash Bai Mina

 

Hi Kalish,


Interesting approach and congratulations on finishing your series.  The OnEvent coding is what makes it all happen!  As your first article got me excited, I developed my one version of the movable panel.  It is a base class that is inherited by individual classes for each panel type.  Secondly, as I had already created a controls header file that was based on examples in the MQL help file, I chose to use it instead of creating a Text class for inheritance and it worked well.  I am planning on creating two more methods for the GUI class, Save and Initialize.  Save will read and update a CSV file and set the starting location positions and data.  Initialize sill read the CSV file and and set the initial positions.

For your review I am attaching a screen shot of my current EA headings and two Panels.  The first is the Active Orders that I will be using and the Sample is the bare bones version used as s template for additional Panels.


Good Luck in your future endeavors, I'll be watching


Cape Coddah

 

The article was really good. Well didactic and explained. I liked. 😁👍

 
CapeCoddah #:

Hi Kalish,


Interesting approach and congratulations on finishing your series.  The OnEvent coding is what makes it all happen!  As your first article got me excited, I developed my one version of the movable panel.  It is a base class that is inherited by individual classes for each panel type.  Secondly, as I had already created a controls header file that was based on examples in the MQL help file, I chose to use it instead of creating a Text class for inheritance and it worked well.  I am planning on creating two more methods for the GUI class, Save and Initialize.  Save will read and update a CSV file and set the starting location positions and data.  Initialize sill read the CSV file and and set the initial positions.

For your review I am attaching a screen shot of my current EA headings and two Panels.  The first is the Active Orders that I will be using and the Sample is the bare bones version used as s template for additional Panels.


Good Luck in your future endeavors, I'll be watching


Cape Coddah

I am glad you are benefitting with my articles.

Actually You motivated me to write this part 3 otherwise it would have taken more time due to lack of motivation.

Thank you very much for that.

Good luck to you too for your future endeavours.

 
Daniel Jose #:

The article was really good. Well didactic and explained. I liked. 😁👍

It’s my pleasure. Thanks for your time.

 

Hi Kailash,

I hope you monitor this article as I do not know how to private text.

Anyway, I I have really incorporated your concepts into a much better way of organizing an EA.  Here is a screen shot of my old version and one using your moveable Panel concept using your part 2 concepts with multiple children.  While it is still in the preliminary development stage, it will allow me to display more pertinent data during model testing.

Right now I have a separate child class for each panel, including the Controller.

clsGUI  GUI;
clsAO   AO;
clsBOB  BOB;
clsCTL  CTL;
clsXO   XO;
clsATR  ATR;
clsRSI  RSI;
clsMM   MM;
clsTS   TS;

//clsAO Guis[egElements];
//clsGui GuiS[egElements];
//object Guis[egElements];

While this approach is adequate, it leads to many separate functions to handle various tasks in the EA panels.  A better approch would be to have  an array of the children and use it as a parameter in the reduced function calls.  I have tried using the first two approaches but I cannot cast the elements of array to the appropriate child class in order to call its unique public functions.  I had limited success in accessing public variables by using a wrapper class  with the object declaration.  Thiis approach seems to use the elements class definition of the parameter element rather that the class definition of the Array

int Wrapper(object &theobject){

return(theobject.aninteger):

}

int i=Wrapper(Guis[5]);

this approach does not work for Guis[5].Create_Controls(......);

The only approach that I have seen that works is to use c_array to create an array of object pointers and add them to the array. and then access by a function that calls the c_array AT(location) function to assign the array pointer to a local  pointer of the object declared locally to access the child variables locally.

Do you or anyone know how to solve this issue or provide a reference to MQL articles or documentation that address an array of child classes rather than an array of one class?

Many many thanks and I am looking forward to your next articles

CapeCoddah

Improperly formatted code eddited by moderator. In the future, please use the CODE button (Alt-S) when inserting code.

Code button in editor