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
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.
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.
New article Universal Expert Advisor: CUnIndicator and Use of Pending Orders (Part 9) has been published:
Author: Vasiliy Sokolov
KINDLY FIX YOUR CODE TO BE COMPATIBLE WITH CURRENT BUILD
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?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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