Error cannot convert enum in mql5

 

Why is it i get the "cannot convert enum" error in mql5? but not mql4?   

In the following i get the error 

int tf=0;
iLow(_Symbol,tf,0);

 But if i type it directly into the parameter there is no error?

iLow(_Symbol,0,0);

Or even the enumeration directly there is no error?

iLow(_Symbol,PERIOD_CURRENT,0);
 
double  iLow(
   const string        symbol,          // Symbol
   ENUM_TIMEFRAMES     timeframe,       // Period
   int                 shift            // Shift
   );

ILow's second parameter is an enumeration, not an int. Cast tf to the enumeration, or define its type as the enumeration.

Compare the above with MT4's definition.

double  iLow(
   string           symbol,          // symbol
   int              timeframe,       // timeframe
   int              shift            // shift
   );
 
William Roeder #:

ILow's second parameter is an enumeration, not an int. Cast tf to the enumeration, or define its type as the enumeration.

Compare the above with MT4's definition.

Thanks for that i see casting works. I never knew you could cast enumerations i thought it was only data types.