default value of Indicator

 

Hi , I am using an indicator (MQL4) which one of its input argument is mystery Enum! I could not figure out how to input its value I thinks it is something like this : 


enum ENUM_NAME{

item1 = 50,
item2 = 100, 
.
.
.
}


as you can see items value are secret! 

second can I at list choose between items first item ( of course in iCustom function) I know How to extract its value I just want to know is there an straight way to choose for example second option?

third how can I use its default value for start at list?( I used NULL but got 'NULL' - expression of 'void' type is illegal error)

thanks in advance...

 
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
 

If you don't know the value, you can't supply it. You must default it and all further parameters in the iCustom call.

Ask the owner.

 
Gholamhossein Eslamizadeh: Hi , I am using an indicator (MQL4) which one of its input argument is mystery Enum! I could not figure out how to input its value I thinks it is something like this :  as you can see items value are secret! second can I at list choose between items first item ( of course in iCustom function) I know How to extract its value I just want to know is there an straight way to choose for example second option? third how can I use its default value for start at list?( I used NULL but got 'NULL' - expression of 'void' type is illegal error) thanks in advance...
#property strict
#property indicator_chart_window

enum ENUM_FRUIT
{
   APPLE  = 1, // An Apple
   ORANGE = 3, // An Orange
   PEACH,      // A Peach
   CHERRY = 8, // A Cherry
   GRAPE       // A Grape
};

input ENUM_FRUIT enumMyFruit = PEACH; // Select Favourite Fruit

int OnInit() { return(INIT_SUCCEEDED); };

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{ return rates_total; };

enum ENUM_FRUIT
{
   APPLE  = 1, // An Apple
   ORANGE = 3, // An Orange
   PEACH,      // A Peach
   CHERRY = 8, // A Cherry
   GRAPE       // A Grape
};

void MyFunction(void)
{
   double bufferValue = iCustom( _Symbol, _Period, "TestFruit", APPLE, 0, 0 );
}
 
@ William Roeder @ Fernando Carreiro
I am so disappointed with you guys!!! Thanks any way I have found the solution.
 
Gholamhossein Eslamizadeh:
@ William Roeder @ Fernando Carreiro
I am so disappointed with you guys!!! Thanks any way I have found the solution.
What wonderful news! To be criticized for offering assistance! How lovely!
 
Gholamhossein Eslamizadeh: Thanks any way I have found the solution.

Don't do that. Someone searching might find this thread and still be clueless. What was the problem? What solved what?

How To Ask Questions The Smart Way. 2004
     When You Ask.
          Follow up with a brief note on the solution.

 

@ William Roeder @ Fernando Carreiro

I guess there is reward or something for specific people to leave comment, Am I right , because people leave not relevant answers to my questions.
I asked totally different question.

William Roeder said Ask the owner. or use default value  ! at list you could kindly answer my  third  question instead of telling the obvious!

 Fernando Carreiro commentED how to use enum!!!! where I asked to how to use enum?!


William Roeder:

Don't do that. Someone searching might find this thread and still be clueless. What was the problem? What solved what?

How To Ask Questions The Smart Way. 2004
     When You Ask.
          Follow up with a brief note on the solution.

that's exactly why I am writing this comment leaving not relevant comments first will confuse the asker second will wonder people who had he same ISSUE

I kindly and politely begging you people do not leave comment if you don't know the answer at list maybe some one could see this question and leave proper answer. this is not the first time I ended up with such attitude! 

Fernando Carreiro:
What wonderful news! To be criticized for offering assistance! How lovely!

I told you I am tankful but you did not answer my question! I just do not understand why you leave this comment! please tell me your comment will answer which part of my question?

 
Gholamhossein Eslamizadeh: I told you I am tankful but you did not answer my question! 

  1. We didn't answer the question because we couldn't. There's no way to get the value of an enumeration from the GUI. Stop blaming us for stating the impossible.
  2. While doing something else I have found a way.
    1. Bring up the indicator's input tab and press Reset. (All values set to defaults.)
    2. Save a template.
    3. Open the template in notepad. You will find the default numerical values for all parameters including the enumeration.
 
William Roeder:
  1. We didn't answer the question because we couldn't. There's no way to get the value of an enumeration from the GUI. Stop blaming us for stating the impossible.
  2. While doing something else I have found a way.
    1. Bring up the indicator's input tab and press Reset. (All values set to defaults.)
    2. Save a template.
    3. Open the template in notepad. You will find the default numerical values for all parameters including the enumeration.

Thanks , that's the only way I could find, I think there is no automatically way to do so. 

Reason: