Is this correct declaration?

 
extern double MaPeriod = 14;
extern double MaShift = 0;
//extern string MAMethodHelp="SMA=MODE_SMA;EMA=MODE_EMA;SMMA=MODE_SMMA;LWMA=MODE_LWMA";
extern double MaMethod = MODE_SMA;
//extern string MAAppliedHelp="PRICE_CLOSE;PRICE_OPEN;PRICE_HIGH;PRICE_LOW;PRICE_MEDIAN,PRICE_TYPICAL;PRICE_WEIGHTED";
extern double MaApplied = PRICE_CLOSE;

No Error while compiling. but in settings it took Value as "0.0" instead of "MODE_SMA"

what will be the issue?

 
Try SMA?
 

MODE_SMA has a value of 0.

By the way, you will get on better declaring these as integers not doubles.

 

Try

extern ENUM_MA_METHOD MaMethod=MODE_SMA;
 
GumRai:

Try

 

 

Yes. Thanks
 
honest_knave: By the way, you will get on better declaring these as integers not doubles.
Don't use doubles. Don't use integers.
extern double MaMethod = MODE_SMA;
extern double MaApplied = PRICE_CLOSE;
Use the proper enumerations.
extern ENUM_MA_METHOD     MaMethod = MODE_SMA;
extern ENUM_APPLIED_PRICE MaApplied = PRICE_CLOSE;
 

I was equally referring to the erroneous declaration of MaPeriod and MaShift as doubles. Enumerations are effectively 4 byte integers

 
honest_knave: Enumerations are effectively 4 byte integers
Not in the GUI
sheriffonline: Value as "0.0" instead of "MODE_SMA"
 
WHRoeder:
Don't use doubles. Don't use integers.
Use the proper enumerations.

I am Newbie and learning MQL4. ofcourse i learnt lot, but still confused with Enumerations!

can you send me sample code for Enumearion?

Definetely i can get idea what mistake i have done?

I tested following example code! but says error message "Variable not Defined"?

enum months  // enumeration of named constants
   {
    January,
    February,
    March,
    April,
    May,
    June,
    July,
    August,
    September,
    October,
    November,
    December
   };
 

January will have 0 but 1! , Feb.=1,... Dec=11

So you have to add 1!

 

sheriffonline: I tested following example code! but says error message "Variable not Defined"?
enum months  // enumeration of named constants
   {
    January,
    February,
    March,
    April,
    May,
    June,
    July,
    August,
    September,
    October,
    November,
    December
   };
That is the definition. same as int or double. Define a variable.
months aMonth = February;
gooly: January will have 0 but 1! , Feb.=1,... Dec=11

So you have to add 1!

No you don't. Set the value you want.
enum months  // enumeration of named constants
   {
    January = 1,
    February,  // Value will default to 2
    March, ...
Reason: