Download MetaTrader 5

enumeration in MQL4?

To add comments, please log in or register
Paul Watson
18
Paul Watson  

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

Nikolay Panev
1093
Nikolay Panev  
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.
sergery
281
sergery  
// 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";
bernd
986
bernd  
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
sergery
281
sergery  
7bit:
Will be possible in MT5

YES.
whroeder1
15590
whroeder1  
extern int MA.Mode.S0E1L3 = 0;
gbulle
127
gbulle  

Now possible using MT4 - Build 600:

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


....

...

input  enum_side side=1;


GB

To add comments, please log in or register