The arrival of a new generation of trading software. What should the EA interface be like? - page 12

 
Yury Kulikov:
How messed up everything is :)
I was talking about an example of creating interface using your file navigator indicator, implemented in Expert Advisor. But do not cling to the words "file navigator", it is an example of a task, and there can be many similar tasks in Expert Advisors: navigator of terminal windows, objects on the chart, indicators in the terminal ... And this is just a small layer of tasks that can be implemented through a list (table) of strings that you want to get in your indicator via global variables.
I'm getting a bit confused now, and I'm missing some of the meaning of your posts. My apologies. A bit later I will describe in detail the concept of the engine, studio, interface and EA. After that we can discuss it. :)
 

1. The concept of the graphics engine.

2. Concept of the graphics core.

3. stages of creating a visual studio for the MT platform.

4. Description of the EA interface creation mechanism.


1. The graphical engine is a program made as an indicator. This program is designed solely for management of the user interface. It performs a set of basic functions:

  • Loading the core of the graphical interface from a file.
  • Saving user interface settings.
  • Implementation of a single and cohesive management of all processes in the interface. It implements the interface "mechanics" including: opening and closing windows, resizing windows, moving windows, merging windows, zooming, playing scripts, changing object states, object bindings, controlling parameter values of controls according to their types and properties, creating and deleting global variables.

The graphic engine is added to the chart like any other indicator. It includes the following set of windows:

  • Taskbar, on the right side of which several icons will be added to call the service windows of the engine itself.
  • File navigator, which will be used to select boot file from a list of files with interfaces located in special folder.
  • Optional settings windows, which do not play a principal role at this stage.

This, in principle, is the end of the graphical engine concept. What is important is that the interface cannot work without it.



2. A graphical kernel is a block of information containing data of all objects and windows in an interface, which is recorded in an array and saved in a file.

This block is a digital representation of the graphical interface. It is loaded by the graphics engine on the user's instruction. The graphics engine itself has its own, internal graphical kernel which ensures the operation of its own windows and inside this kernel the free space is allocated for the integration of the user interface (in the digital form) into it. Integration is performed in the process of loading the graphical core from a file.


3. Creating a visual studio on the MT platform, as I understand it, is divided into two stages:

  • In the first stage, a file-based version of the interface builder will be created. In it, the user will work with table templates. In the tables, the user will write the types and names of interface elements and set properties of their parameters. Creation will be extremely easy for user, he won't have to worry about correct positioning of his elements in the windows (the engine will calculate everything automatically) and it will be enough just to arrange elements in required order.
  • In the second phase, a visual environment will be created that implements the same interface construction method as the file constructor, only it will be easier and more convenient to use. It will also add the ability to change the appearance of the controls. In general, the user will have more graphical options.


4. I want to outline the mechanism of creating an interface in general terms, and slightly lift the veil on its technology. Explain where the ease of creating an interface via a file will come from.

This is the case: the engine has a special function which creates a complete graphical kernel based on a single file with a minimum amount of loading information. Boot information in this file is self-explanatory and human-readable. It is easy to write and edit. For example you need to write "_CREATE_NEW_WINDOW" to create a window, and "_CHECKBOX" and name of checkbox, (engine automatically recognizes name of element, as name of element itself and as name of its parameter).

This function is called "G_CORE_BUILDER()" and it builds the graphical core by taking data from two main sources: a bootup file created by the user and the "CONTENT[]" array, which holds all the standard object groups included in window platforms and controls. "CONTENT[]" also contains states and scripts of objects. Everything in one array. In general, the source material from "CONTENT[]" + the loader file created by the user is used by "G_CORE_BUILDER()" to build the graphical core with which the engine works.

 

To avoid confusion, I would like to add that the boot file can be in two formats:

1. In the form of a set of user-defined instructions, which describe windows, controls and properties of their parameters. In this case, at the stage of loading, function "G_CORE_BUILDER()" is launched and builds the graphical core.

2. In the form of the ready graphic core which is loaded directly to the engine. In this variant, there is no need to use "G_CORE_BUILDER()" function.

The first option would be used in the interface constructor and the second to run the ready-made interface of any application.

A simplified version of the engine will load the ready-made graphical kernel, from which the kernel construction system ("G_CORE_BUILDER()" and the "CONTENT[]" array will be removed) , in order to simplify its operation.
 
Реter Konow:
Drawing a picture is not an interface yet, the most important question you are not mentioning is how the Expert Advisor will interact with the indicator, the"global variables" sounds somehow vague.
 
Yury Kulikov:
Drawing a picture is not the interface yet, the most important question you miss - how the EA will interact with the indicator, through the"global variables" sounds somehow vague.
At the moment the system of interaction of the Expert Advisor with the interface implemented in the indicator with global variables is only on the paper, and I haven't had any experience in its creation. I will try to describe my idea in more detail, and if you find contradictions or errors in it, please comment.

1. Let me remind you what everyone knows - each global variable is in scope of all programs loaded to the chart. To create a global variable, you must call the special function, and pass to it the name of variable and its value.

2. Global variables will be created by the engine at the stage of loading the interface, which will read the boot file. The global variable names and their saved (or preset) values will be written in the boot file itself.

3. There is a special block inside the engine which is responsible for controlling the parameter values of the controls according to the item type, value type and parameter properties. When the user ticks a checkbox or remaps a value in a 'spin edit' element, the control's parameter interaction block performs specific actions on a specific value, a specific variable.

4. Due to the fact that the variable is global, its value will be constantly "observed" by the Expert Advisor, and it will react to changes of the value of each of the global variables according to the algorithms embedded in it.

5. The Expert Advisor not only "observes" the global variables, but works completely with their values from its functionality. In this case, it is important to understand that the global variables will be conditionally divided into two types: variables "controlled" by the user, the values of which will be set by the user through the controls in the interface, and variables "controlled" by the EA functionality, the values of which will be set by the user functions.

6. The engine, in turn, will work with both conditional global variable types. I have described the principle of working with values of variables "under control" of the user, and the principle of working with values "under control" of the EA functionality will be as follows: the same block conditionally divides the controls into two categories: those that control the value, and those that display the value (displaying it in any way). Each such control (input field, progress bar, etc...) is subscribed to its variable's value change event. As soon as value of any variable changes, block refers to corresponding element and performs manipulation with that element, which is provided in element type by default.

Note that the block loops through all global variables at the timer frequency, thus "following" the behavior of the values of the functionally controlled variables.

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
P.S. As for the question about how to load EA settings from the user interface, in my mind, it will be done in the following way:

The values of all global variables, with which the EA operates (including those that represent the EA's settings), will be stored in the loading file before being destroyed at the EA's unloading event. At every loading of the interface, these same global variables will be created again and will take their original values. Then the Expert Advisor will be loaded and access its variables.
 
Реter Konow:

How can text (e.g. file name) be passed through a global variable?

How can the Expert Advisor activate/deactivate a window?

How can the Expert Advisor create a new window while the Expert Advisor is running?

...

 
Yury Kulikov:

1. How do I pass text (e.g. filename) through a global variable?

2. How can the expert activate/deactivate the window?

3. How can the Expert Advisor create a new window while the Expert Advisor is running?

...

1. This task has not been solved yet. I can suggest a couple of variants at a guess:

a) Passing the string by means of global variable name itself. Since the variables are indexed, the engine and Expert Advisor always need to "know" the index of the glob variable to be erased and created again to transfer the text, changing its name each time and passing the string through it. At first glance, the option looks messy, but who knows, maybe it can be improved...

b) To transmit a string with value of one variable, consecutively with letters, where instead of letters themselves the corresponding numbers will be transmitted, and the process of transmission will be carried out in n-number of timer periods.

2. At the moment, my concept lacks method of activation/deactivation of windows on the EA side. To be honest, I'm not quite sure what you mean. The windows will only be dealt with by the user and the engine. The Expert Advisor only deals with variables and its own functions. He has no access to the interface yet. (And what's the point?).

3. new (composite) windows, which user can group sets of (component) windows at his discretion, will be created by the engine and not the Expert Advisor. for example, by clicking on the "new window" main menu item. It is important that all of the grouped windows are already created in the interface and the number of composite windows used to group the user's required information can be (conditionally) unlimited. The window sets and their contents will be saved in a file.

 
Реter Konow: It has no access to the interface yet. (And what's the point in that?)

The point is fundamental. Events don't just occur in the interface.

There will be more than one iceberg in the way of your Titanic. You have started the project from the wrong side and global variables will not help here.

 
Yury Kulikov:

The point is fundamental. Events don't just occur in the interface.

There will be more than one iceberg in the way of your Titanic. You started the project on the wrong side and global variables will not help.

Well, what edge do you think I should have started the project on, and what can help me?
 
Реter Konow:
OK, but where do you think I should have started the project, and what can help me?

I think we should start with the Expert. I have given three types of tasks that are relevant to an expert, but it turns out they are not feasible in your interface.

What could help? Perhaps deeper integration, or limiting the project to "remote control".

Reason: