why I cannot use ENUM_APPLIED_VOLUME even though it's in docs?

 

I try to port an indicator from MT5 to MT4,

and this error is all over the place. for example:

'ENUM_APPLIED_VOLUME' - declaration without type        utils_mql5.mqh  353     69

Apparently this type is not recognized, although I find it in mql4 docs

what can I do about it? Is this a bug? Am i doing something wrong? 


 
"Declaration without type" isn't using it. You are apparently trying to declare it. Post the code.
 

There are some 6 functions like this one:

double cdl_volume(MqlRates &r, ENUM_APPLIED_VOLUME _which=VOLUME_TICK) {
   if ( _which == VOLUME_TICK) 
      return ( r.tick_volume );
   else
      return ( r.real_volume ); 
}

the error appears only in these cases.

 

What's more,
if I type (anywhere) ENUM_APPLIED, the autocompletion feature recognizes ENUM_APPLIED_PRICE only

Shouldn't the autocompleter recognize the ENUM_APPLIED_VOLUME also? 

 
  1. EAV is only meantioned on the Price Constants - MQL4 Documentation Since no functions use it it's probably not implemented in mt4. Is used in MT5.
  2. Try
    enum ENUM_APPLIED_VOLUME { VOLUME_TICK, VOLUME_REAL };
    double cdl_volume(const MqlRates& r, ENUM_APPLIED_VOLUME _which=VOLUME_TICK) {
       return _which == VOLUME_TICK ? r.tick_volume : r.real_volume; 
    }



 

Thank you for point this solution out.

I thought about it myself, but I didn't know if VOLUME_TICK came first.

I will drop a message to service desk anyway 

Reason: