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

Back to topics list To post a new topic, please log in or register
avatar
11
ifmihai 2015.04.07 23:12
 

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? 


avatar
13009
WHRoeder 2015.04.08 03:01 #
 
"Declaration without type" isn't using it. You are apparently trying to declare it. Post the code.
avatar
11
ifmihai 2015.04.08 14:45 #
 

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? 

avatar
13009
WHRoeder 2015.04.08 20:01 #
 
  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; 
    }




avatar
11
ifmihai 2015.04.09 12:18 #
 

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 

Back to topics list  

To add comments, please log in or register