
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
[in] Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
[in] Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.
So next question will be, what is the member of any ENUM_APPLIED_PRICE ? Is it in form of integer ? The answer is yes, it is an integer.
enums have an integer value.
either of these is acceptable
my point was about the user defined enum which also have the same integer value.
Compiler: 'PRICE' - improper enumerator cannot be used
compiler rejects my user defined PRICE enum. Which also has the same value as PRICE_HIGH enum and the integer value 2 and IMO should be accepted by the compiler as a correct parameter in iMA().
The workaround is to copy the value from the enum to an integer and then use that integer as the parameter. That seems like extra code for no good reason and defeats the object of enumerating the constants in the first place.
OK I posted to the service desk about this, in case anyone is interested the support team told me how to do it, by using explict cast:
{
CLOSE,
OPEN,
HIGH,
LOW
{
CLOSE = PRICE_CLOSE,
OPEN = PRICE_OPEN,
HIGH = PRICE_HIGH,
LOW = PRICE_LOW
Yes for sure, the integer values of the enums have to be the same as the predefined ones. You can assign the values explicitly like you did by enum or by the correct integer value. For the debugging reason you mentioned it is probably best to always do this even if the default sequential enumeration would assign the correct values.
Yes for sure, the integer values of the enums have to be the same as the predefined ones. You can assign the values explicitly like you did by enum or by the correect integer value. For the debugging reason you mentioned it is probably best to always do this even if the default sequential enumeration would assign the correct values.
I'm sure you know, but that comment on the CLOSE = 0 line will change how that appears in the dropdown list.