You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Why create a new one that is identical to an existing one? You can't use yours with TimeDayOfWeek unless you write conversion routines between your days and enum_day_of_week. Etc.
Why create a new one that is identical to an existing one? You can't use yours with TimeDayOfWeek unless you write conversion routines between your days and enum_day_of_week. Etc.
I dont understand what you mean by that, correct me if I am wrong but all enums are identifiers to integer values right ? So how is there any difference between user created enums and predefined ones ?
Is this what you mean ?
for example the user needs to chose from only Close, Open, High, Low prices and not any of the others so the predifined ENUM_APPLIED_PRICE is not suitable.
Compiler: 'PRICE' - improper enumerator cannot be used
The enum has a correct integer value yet the enum is not allowed UNLESS it is the predefined APPLIED_PRICE enum. What is the point of this error ?
So now take the value from the enum and put it in a regular integer instead ....
Compiler: 0 error(s), 0 warning(s)
Now the value is in an integer the compiler allows it, the compiler error is not logical.
Is this what you mean ?
for example the user needs to chose from only Close, Open, High, Low prices and not any of the others so the predifined ENUM_APPLIED_PRICE is not suitable.
Compiler: 'PRICE' - improper enumerator cannot be used
The enum has a correct integer value yet the enum is not allowed UNLESS it is the predefined APPLIED_PRICE enum. What is the point of this error ?
So now take the value from the enum and put it in a regular integer instead ....
Compiler: 0 error(s), 0 warning(s)
Now the value is in an integer the compiler allows it, the compiler error is not logical.
Or by converting it to integer, will give no error ...
The reason for compiler error in your code is that because 6th parameter of iMA must be an integer and should not be other than integer.
In your code, variable/data type of "Prices" is enum and not integer. That's why compiler say "I can't use other than integer for 6th parameter of iMA". Hence the err.
The reason for compiler error in your code is that because 6th parameter of iMA must be an integer and should not be other than integer.
No, it must be enumeration and should not the other than enumeration.
The word is that casting int->enum is implemented, while enum->enum throws error.
No, it must be enumeration and should not the other than enumeration.
The word is that casting int->enum is implemented, while enum->enum throws error.
Please click and check the 6th parameter of iMA (https://docs.mql4.com/en/indicators/ima).
It is integer, and not some enum type.
Assign integer to some enum type is OK, though it will give compiler a warning.
Please click and check the 6th parameter of iMA (https://docs.mql4.com/en/indicators/ima).
It is integer, and not some enum type.
Assign integer to some enum type is OK, though it will give compiler a warning.
The compiler does not know the site you linked. It still demands enumeration.
The compiler does not know the site you linked. It still demands enumeration.
Wow, use MQL documentation instead some ME pop-out, please.
Read again the link I gave (https://docs.mql4.com/en/indicators/ima, click that please), the 6th parameter of iMA function needs integer parameter.
For 6th parameter of iMA, we can use any member of ENUM_APPLIED_PRICE - click that please - which its members are integer value. ENUM_APPLIED_PRICE is a built-in enum inside MQL4 for price constant, so when we using ENUM_APPLIED_PRICE, the compiler will typecast it immediately and give no warning.
Since on code above we're not using any member of ENUM_APPLIED_PRICE, but we use our own enum, we have to typecast it to integer.