enumeration in MQL4?

 

Can enumeration be used in MQL4? I'd like to have input parameters where an input is Moving Average Method and the user has a choice of Simple, Exponential, etc instead of having to input 0, 1, etc. Is that possible?


Thanks,

Paul

 
pwwatson:

Can enumeration be used in MQL4? I'd like to have input parameters where an input is Moving Average Method and the user has a choice of Simple, Exponential, etc instead of having to input 0, 1, etc. Is that possible?


Thanks,

Paul

Unfortunately not possible.
 
// you may use the below codes as a note
extern string MaMethod="Ma_Method's Number Value";
extern string SMA="0";
extern string EMA="1";
extern string SSMA="2";
extern string LWMA="3";
 
pwwatson:

Can enumeration be used in MQL4? I'd like to have input parameters where an input is Moving Average Method and the user has a choice of Simple, Exponential, etc instead of having to input 0, 1, etc. Is that possible?

Will be possible in MT5
 
7bit:
Will be possible in MT5

YES.
 
extern int MA.Mode.S0E1L3 = 0;
 

Now possible using MT4 - Build 600:

enum enum_side
{
    BUY=1,
    SELL=-1
   
};


....

...

input  enum_side side=1;


GB

Reason: