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

 
Dennis Kirichenko:

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


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

Well, it's simple here - let's have a bunch of orders on EURUSD. We calculate separately for each direction and get:

  1. total position Buy 20 lots at 1.2000 = Buy 15 lots at 1.2000 + Buy 5 lots at 1.2000
  2. total Sell position 15 lots at 1.2200
Anniligating the equal volumes leaves 5 lots at 1.2000. What is wrong with my reasoning? Open a bunch of positions on Monday and see how the floating profit/loss will change with a 1 pip change in price.
 
Rashid Umarov:

Well, it's simple - let's say we have a bunch of orders on EURUSD. We calculate separately for each direction and get:

  1. total position Buy 20 lots at 1.2000 = Buy 15 lots at 1.2000 + Buy 5 lots at 1.2000
  2. total Sell position 15 lots at 1.2200
Anniligating the equal volumes leaves 5 lots at 1.2000. What is wrong with my reasoning? Open a bunch of positions on Monday and see how the floating profit/loss will change with a price change of 1 pip.

This is a system in MT5 hedging: counter positions are cancelled by nominal volumes.

There is also an alternative, which I wrote about in the previous post. It takes into account the value of each bought/sold volume. The result is the ratio of volume value to nominal volume.

 
Dennis Kirichenko:

This is such a system in MT5 hedging: counter positions are annihilated by nominal volumes.

You can write in clear words. I don't understand anything here. Gorbachev used to communicate like this - a lot of words, but it's not clear.
 
Rashid Umarov:
You can write in words that make sense. I don't understand anything here. Gorbachev used to talk like this - lots of words, but you can't understand a damn thing.

Pardon!

We bought 20 lots at $1,2000.

The nominal volumes (volumes in base currency) of the purchase are equal to 20*100 000 = EUR 2 000 000. The value of these volumes in the quote currency is equal to $1,2000*2,000,000 = USD 2,400,000.

By nominal I meant the value of volumes in the base currency of the symbol.

 

Well, I'm not a fan of chasing numbers back and forth)

Not to mention the potential rounding errors in such operations.

 
In the file CProgram.mgh replaced the indicator instead of iStohastic in the functions "void CProgram::GetHandles(void)" and "void CProgram::GetIndicatorValues(void)" with the indicator m_handles[i]=::iATR(m_symbols[i],StringToTimeframe(tf),5); Everything compiled fine, but in the table in the "values" column there are only zeros. What did I do wrong?
 

Alexander:

...

What did I do wrong?

The zero buffer should be specified for ATR:

//+------------------------------------------------------------------+
//| Gets the indicator values of all characters ||
//+------------------------------------------------------------------+
void CProgram::GetIndicatorValues(void)
  {
...
         //--- Let's try to get the indicator values
         double values[1];
         received=::CopyBuffer(m_handles[i],0,0,1,values);
...
  }
 

Greetings Anatoli,


thanks for all your great efforts! So very much appreciated! :)

I've got a question: Where is the ON_END_CREATE_GUI being defined? I cannot find it in any source of your latest version Build 16 (neither in any sources of Build 15).

So far I have downloaded the source code of build 16 from https://www.mql5.com/en/articles/3527

and then downloaded your changes in the articles:

https://www.mql5.com/en/articles/4715 and
https://www.mql5.com/en/articles/4727.

What am I missing, can you or someone else help?

Best regards!


P.S.: Anatoly, would it be possible to offer just one update zip file instead of adding pieces in various articles? I found it quite difficult to "track" all your changes... :)

Ein Expert Advisor mit GUI: Erstellen des Panels (Teil I)
Ein Expert Advisor mit GUI: Erstellen des Panels (Teil I)
  • www.mql5.com
Trotz der aktiven Entwicklung des algorithmischen Handels bevorzugen viele Händler immer noch den manuellen Handel. Die Automatisierung von Routineaufgaben lässt sich jedoch kaum ganz vermeiden. Der Artikel zeigt die Entwicklung eines Expert Advisor mit Signalen von mehreren Symbolen für den manuellen Handel. Als Beispiel verwenden wir die...
 

It's quite simple:

1) near ON_END_CREATE_GUI there's a link at the top, a little above that the link EasyAndFast

and then the file Defines.mqh, that's it.

[Deleted]  

Dear developers! Please pay attention to the following error. If the name of the Expert Advisor from this article is left TradePanel - the Expert Advisor is launched (build 2280). However, if you rename it, for example, TradePanel_part_II - the Expert Advisor compiles but does not start. It writes the following in the log:

2020.02.11 19:18:02.987 TradePanel_part_II (RTS Splice,M1) CElement::CreateCanvas > Не удалось создать холст для рисования элемента (CSeparateLine): 4016

2020.02.11 19:18:02.987 TradePanel_part_II (RTS Splice,M1) CElement::CreateCanvas > Не удалось создать холст для рисования элемента (CSeparateLine): 4016

2020.02.11 19:18:03.042 TradePanel_part_II (RTS Splice,M1) CElement::CreateCanvas > Не удалось создать холст для рисования элемента (CButton): 4016

2020.02.11 19:18:03.042 TradePanel_part_II (RTS Splice,M1) OnInit > Could not create the GUI!

If you name the Expert Advisor, for example, TradePanel 2, everything is normal. It seems that certain names cause problems with resources.