Discussion of article "Universal Expert Advisor: CUnIndicator and Use of Pending Orders (Part 9)"

 

New article Universal Expert Advisor: CUnIndicator and Use of Pending Orders (Part 9) has been published:

The article describes the work with indicators through the universal CUnIndicator class. In addition, new methods of working with pending orders are considered. Please note: from this point on, the structure of the CStrategy project has undergone substantial changes. Now all its files are located in a single directory for the convenience of users.

The screenshot below shows a test fragment of CIpmulse 2.0 in the strategy tester. It shows the placed pending orders and the work with them:


Fig. 1. Working with pending orders during the test of the Impulse 2.0 strategy

Author: Vasiliy Sokolov

 

Hey excellent series of article for the newbie to understand the best practice around coding EA. I didnt followed religiously everything you mentioned here on the article, but as mentioned in the article do not need to understand the inside mechanism as long as structure make sense. When i tried to compile the strategy i got error message, so checking if the template is still relevant. It seems the method are expecting the data type in declaration as its complaining about unexpected token, probaby type is missing!

Do I have to include the datatype of the return value in all the method to compile the code?

Thanks 

Files:
Impulse.JPG  192 kb
 
B Thakks:

Hey excellent series of article for the newbie to understand the best practice around coding EA. I didnt followed religiously everything you mentioned here on the article, but as mentioned in the article do not need to understand the inside mechanism as long as structure make sense. When i tried to compile the strategy i got error message, so checking if the template is still relevant. It seems the method are expecting the data type in declaration as its complaining about unexpected token, probaby type is missing!

Do I have to include the datatype of the return value in all the method to compile the code?

Thanks 

Hi B Thakks

we are in the same boat :)

did you got it sorted ?

I have same error in PositionMT5.mqh, the file itself compiles with NO Error. However, when compiling Trailing.mqh, this error shows for PositionMT5.mql file. screenshot is attached for easy reference.

Though Impulse 2.0.mq5 EA is working without any error warning, but it seems it is not calculating trailing stop.

Any suggestions will be highly appreciated.

Regards. 

Files:
Error.jpg  79 kb
 
Hello everyone, I have recently registered in this comunity, I am trying to learn this language better and better, and here, I often read the comments and I have found a world of people trying to help each other, and this it's very beautiful. About this series, I must say that it is very very interesting and programmed at a high level. However, I would like to have a clarification. In the Expert published in this last article (9), I noticed that "Manager.OnTick ()" is executed in the OnTick function in the main file (Impulse 2.0.mq5). In this method you can check new ticks and new candles also of many other currency pairs (talking about Forex). But the Manager.OnTick() method is only executed when a Tick occurs in the currency pair where the EA is executed, so if here, for example no ticks occur for a minute, how can you check the ticks in another currency pair?
Thanks .. I hope you can clarify this doubt.
Hello everybody.
Alexander
 

Excellent piece of code and sample.

But useless for newbies as most of the examples will not work without compilation error and you need to have same level of knowledge as the writer of article to debug them. 

 

Seems that some methods are defined like constructors, therefore the compilation errors.

You have to add void in front of the wrong code.

Example:

Message.mqh could not be compiled because of the following error:

'Init' - unexpected token, probably type is missing?    Message.mqh     80      11
'Init' - function already defined and has different type        Message.mqh     80      11

Code looks like this:

CMessage::Init(ENUM_MESSAGE_TYPE type,string source,string text)

All you have to do is to add a void in front of the line:

void CMessage::Init(ENUM_MESSAGE_TYPE type,string source,string text)

There are several files affected (e.g. Dictionary.mhq as shown in first post) but after correcting them, the code will compile without errors.

 

KINDLY FIX YOUR CODE TO BE COMPATIBLE WITH CURRENT BUILD


 
FLB #:

You have to add void in front of the wrong code.

[...]

There are several files affected (e.g. Dictionary.mhq as shown in first post) but after correcting them, the code will compile without errors.

Yes, this got it to compile without errors, and the EA will run in the Strategy Tester, but it makes no trades. Tried on multiple symbols and timeframes, and on default values on all symbols in market watch.

Don't even know where to begin debugging it.  Anyone else gotten this to work?

Reason: