Proper inputs for Custom indicator
-
Hello,
I have a custom indicator that i'm trying to use in an EA that I don't have the source code to (.EX5). I think the issue i'm having is properly defining the input parameters, I have no problems doing this in MT4 but this is my first attempt at creating one in MT5 and it has dropdown menu options for 3 of the inputs. I have tried many different things but usually the result is error 4002 when testing, changing the data type (int, string), changing the input from how it is named in the indicator to Standard Constants (Typical price, PRICE_TYPICAL).
I will upload screen shots for reference.Any help is greatly appreciated.
James -
and the 4th pic
......
Untitle4.png -
First check if the number of input parameters is correct.
Then, for parameter names, you should use the original names, but they are not actually visible. They look like variable names - only latin letters and numbers, no empty space. What you see, for example "Applied Price" is not the real name. In the code you have something like this:
input ENUM_APPLIED_PRICE AppliedPrice = PRICE_TYPICAL; // Applied PriceI'm not sure about "AppliedPrice", because this exists in the source code.
ENUM_APPLIED_PRICE is the data type, also known as enumeration, which is some kind of integer data type, but not exactly. You can use "int" anyway, I think there will be no problem.
PRICE_TYPICAL is the name of one predefined constant that has value of 5. No, "Open price" doesn't mean nothing here.Here is about the ENUM_APPLIED_PRICE enumeration: https://docs.mql4.com/constants/indicat ... price_enum
Parameter values must be correct as well. For example "Open price" is a string value, it is not an "int" or ENUM_APPLIED_PRICE value. You can use PRICE_TYPICAL or even 5 here, but not "Open price" or any other non-numeric value.
The next thing is the data types, but I don't think this is the problem here. Yes, in the indicator each input parameter probably have different data type (or enumeration), but when you use the indicator form the EA, there should be no problem to use "int" instead of enumeration that is in nature an integer value.