Discussion of article "DoEasy. Controls (Part 1): First steps"

 

New article DoEasy. Controls (Part 1): First steps has been published:

This article starts an extensive topic of creating controls in Windows Forms style using MQL5. My first object of interest is creating the panel class. It is already becoming difficult to manage things without controls. Therefore, I will create all possible controls in Windows Forms style.

Compile the EA and launch it on the chart:


Forms react to mouse movement and are always placed on top of graphical objects added to the chart. Gradient fillings of element objects are drawn correctly and there is only one panel object color. However, neither the elements, nor the panel react to the mouse and are located in the background under all graphical objects. This happens because I handled mouse events for form objects only. The fact that the panel is essentially a form does not matter since I explicitly handle the CForm class only. I will fix all this later.

Author: Artyom Trishkin

 

I congratulate you on all your hard work...this was quite the project.

I am just starting on this and am trying to compile the TestDoEasyPart101.mq5 ... I am getting the following 4 errors:


1) CTrading::OpenPosition<...... (cannot access private member function)


all the other errors are basically the same, so I must having a path problem but can't narrow it down.

I copied the DoEasy Files for include so the heirarchy is as follows:

MQL5\Include\DoEasy\all the files that were in your DoEasy folder under the include

I did the following at the top of the TradingControl.mqh file:   #include <DoEasy\trading.mqh>


what might be my problem...as I said it appears you did at least 100 articles to build what you have at the start of this...any suggestions on how I get this to compile?


thank you

Dean Fredrickson

 
Dean Fredrickson # :

I congratulate you on all your hard work...this was quite the project .

I am just starting on this and am trying to compile the TestDoEasyPart101.mq5 ... I am getting the following 4 errors:


1) CTrading::OpenPosition<...... (cannot access private member function)


all the other errors are basically the same, so I must having a path problem but can't narrow it down.

I copied the DoEasy Files for include so the heirarchy is as follows:

MQL5\Include\DoEasy\all the files that were in your DoEasy folder under the include

I did the following at the top of the TradingControl.mqh file:   #include <DoEasy\trading.mqh>


what might be my problem...as I said it appears you did at least 100 articles to build what you have at the start of this...any suggestions on how I get this to compile?


thank you

Dean Fredrickson

In the Trading.mqh file, make the following changes:

 //--- (1) Открывает позицию, (2) устанавливает отложенный ордер
 protected : 
   template < typename SL, typename TP> 
   bool                  OpenPosition( const ENUM_POSITION_TYPE type,
                                     const double volume,
                                     const string symbol,
                                     const ulong magic= ULONG_MAX ,
                                     const SL sl= 0 ,
                                     const TP tp= 0 ,
                                     const string comment= NULL ,
                                     const ulong deviation= ULONG_MAX ,
                                     const ENUM_ORDER_TYPE_FILLING type_filling= WRONG_VALUE );
   template < typename PR, typename PL, typename SL, typename TP>
   bool                  PlaceOrder( const ENUM_ORDER_TYPE order_type,
                                     const double volume,
                                     const string symbol,
                                     const PR price,
                                     const PL price_limit= 0 ,
                                     const SL sl= 0 ,
                                     const TP tp= 0 ,
                                     const ulong magic= ULONG_MAX ,
                                     const string comment= NULL ,
                                     const datetime expiration= 0 ,
                                     const ENUM_ORDER_TYPE_TIME type_time= WRONG_VALUE ,
                                     const ENUM_ORDER_TYPE_FILLING type_filling= WRONG_VALUE );
 private :                                     
 //--- Возвращает индекс объекта-запроса в списке по (1) идентификатору,
 //--- (2) тикету ордера, (3) тикету позиции в запросе 
   int                   GetIndexPendingRequestByID( const uchar id);
   int                   GetIndexPendingRequestByOrder( const ulong ticket);
   int                   GetIndexPendingRequestByPosition( const ulong ticket);

 public :
 //--- Возвращает себя 
   CTrading            *GetObject( void )    { return & this ;   }
 //--- Конструктор 
                        CTrading();

This will allow methods to be visible from derived classes.

The error was introduced by me due to inattention, but the old compiler missed it. After updating the terminal, the compiler saw this error.

Reason: