Undeclared Identifier EA Wont Compile
-
The indicator compiles in mt5
https://www.mql5.com/en/code/1352
but the test EA will not
0_1638938242311_20211203 i_klprice Test (1).mq5
Could you please help me out with this one - been trying to solve it for over a week
-
@kriordan said in Undeclared Identifier EA Wont Compile:
The indicator compiles in mt5
https://www.mql5.com/en/code/1352
but the test EA will not
0_1638938242311_20211203 i_klprice Test (1).mq5
Could you please help me out with this one - been trying to solve it for over a week
The indi compiling has nothing to do with the EA in regards to a problem you may be having. but please provide screenshots of whats failing where to help troubleshoot. and detail the steps youve done
-
The problem is in that there is no constant with name MODE_JJMA defined. Looking at the code, this constant comes from enumeration called Smooth_Method. But this enumeration is defined in another file - smoothalgorythm.mqh. This file is of course not read from the EA builder and it didn't know what this enumeration is.
What's about these enumerations? They are used to make such custom data types, you see what the result is in the Inputs of the indicator, you have nice select menus there. But when the indicator uses its own enumerations, because they are custom data types, the EA doesn't know about them. The EA knows what double, int, string, bool is, there are even some pre-built enumerations that can be accessed from both, the indicator and the EA. But when the indicator uses its own custom enumeration, this same enumeration must be copied into the EA so the EA knows what it means. Or at least I don't know how the EA can "see" these custom enumerations in the Indicator. So when you add a new indicator in fxDreema, it tries to read the enumerations. This indicator uses two enumerations, however one of them is imported from another file. It's actually written in the indicator itself, but it is commented.
I added this enumeration to your indicator. Hopefully it will work now.
-
Thanks for your response and the test EA now compiles
The author of the indicator has many others that use external files so will try to modify these as you have done