The arrival of a new generation of trading software. What should the EA interface be like? - page 12
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
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.
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:
The graphic engine is added to the chart like any other indicator. It includes the following set of windows:
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:
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.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.
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.
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?
...
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.
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.
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.
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".