Discussion of article "Expert Advisor featuring GUI: Adding functionality (part II)"

 

New article Expert Advisor featuring GUI: Adding functionality (part II) has been published:

This is the second part of the article showing the development of a multi-symbol signal Expert Advisor for manual trading. We have already created the graphical interface. It is now time to connect it with the program's functionality.

The gif image below displays the following. The table features the list of forex symbols containing USD. Then, we quickly form the list of symbols containing EUR. To do this, enter "EUR" in the Symbols filter input field and click Request. If you want to see all symbols with USD and EUR available on the server, they should be comma-separated: "USD,EUR".

  Fig. 3. Forming the list of Forex symbols

Fig. 3. Forming the list of Forex symbols

Forming the list of forex symbols and getting the indicator handles is performed on the period specified in the Timeframes combo box. If we select another timeframe in the drop-down list, we should receive the new handles and update the table values. To achieve this, we need the CProgram::ChangePeriod() method. If the combo box ID has arrived, first update the timeframe in the object chart. Then, get the handles and indicator data for all table symbols. After that, the table is updated to display the implemented changes.

Author: Anatoli Kazharski

Expert Advisor featuring GUI: Adding functionality (part II)
Expert Advisor featuring GUI: Adding functionality (part II)
  • www.mql5.com
In the previous article, I demonstrated how to quickly develop the EA graphical interface (GUI). Here we will connect the already developed GUI with the EA functionality.  Getting symbol and indicator data First, we need to arrange getting symbol and indicator data. Let's present forex symbols as a table relying on the filter values in the...
 
Anatoli Kazharski | 12 Oct 2016 at 14:54 RU
Pavel Kolchin:

Will there be a mini-manual on how to use the current version of the library without studying all the previous articles?

Yes, but only after the main part of the library and all the necessary functionality will be formed.


Thank you, but I would like to repeat the question

Will there be a mini-manual how to use the current version of the library without studying all the previous articles?

 
IuriiPrugov:

Thanks, but I would like to repeat the question

Will there be a mini-manual on how to use the current version of the library without studying all the previous articles?

Maybe someday there will be.

You don't need to study all the articles to learn how to use the library.

Start with the examples that are presented in these articles:

If you want a detailed help, you can try to start the process of creating it through Freelance service. It is possible that someone will take on such work.

 
Does it work in the strategy tester?
 
The example posted in the article does not compile. When compiling, it generates an error: "'ON_END_CREATE_GUI' - undeclared identifier Programme.mqh 307 29" !

 
Alexander:
The example posted in the article does not compile. When compiling, it generates an error: "'ON_END_CREATE_GUI' - undeclared identifier Programme.mqh 307 29" !

The latest version is always here: EasyAndFast

And update the classes that are attached to the article.

 
. ... Rick D. ... .:
Does it work in the strategy tester?

Partially.

 

Anatoly, thank you once again for your work.

I have a question. On the average price of an aggregate position.

I have TradePanel Expert Advisor hanging on the chart.


Open price of the hedged position


There are 6 multidirectional positions. The panel, as you can see, shows that the opening price of the aggregate position is equal to 1.16272. Is it correct to calculate the average price for multidirectional positions in this way?

 
Dennis Kirichenko:

...

There are 6 multidirectional positions. The panel shows that the opening price of the cumulative position is 1.16272.

Is it correct to calculate the average price for multidirectional positions in this way?

I don't know. What do you think?

It is possible that from the point of view of "sorting out the situation for multidirectional positions", it is better to count separately for buy and sell.

 
Anatoli Kazharski:

I don't know. What do you think?

It is possible that from the point of view of "sorting out the situation on multidirectional positions", it is better to count separately for buy and for sell.

The right way is to calculate the average price for each direction separately. Then subtract the smaller one from the larger position - this will be the volume and direction of the total position. And also the average price of the position, which is equal to the average price of the larger position.

 
Rashid Umarov:

The correct way is to calculate the average price for each direction separately. Then subtract the smaller one from the larger position - this will be the volume and direction of the total position. And also the average price of the position, which is equal to the average price of the larger position.

Rashid, thank you for your comment. Then in my case the calculation is on the larger side (Buy):

Open price Base Volume Quote Volume
1,16255 10 000,00 11 625,50
1,16252 10 000,00 11 625,20
1,16937 16 000,00 18 709,92
36 000,00 41 960,62
Average: 1,16557


There's also the cost approach, where everything is combined into one pile.

Open price Base Volume Quote Volume
1,1625510 000,0011 625,50
1,1625210 000,0011 625,20
1,15376-10 000,00-11 537,60
1,15413-10 000,00-11 541,30
1,1693716 000,0018 709,92
1,16933-11 000,00-12 862,63
5 000,00 6 019,09

Average: 1.20382


The second case takes into account the fact that they sold cheap, so the price of the remaining purchases became higher.