Download MetaTrader 5
To add comments, please log in or register
Find out how to install MetaTrader on Linux
Seyed AmirBabak Teymourian
123
Seyed AmirBabak Teymourian 2011.07.18 15:47 

how to code a combo box for input parameters?

for example, I want to add Time Frames, to be selective...(M1-M5-...MN1)

Ian Venner
2583
Ian Venner 2011.07.18 16:01  

I dont believe its possible to do this, for some reason metaquotes didnt consider that neccessary which in my opinion is stupid considering they use combo boxes in their own built in indicators, and in the properties box for custom indicators bools automaticaly have a dropdown with two choices, but as far as i know there is no way to define a custom combo box from within the code or make dropdown menues for input parameter choices.

whroeder1
13619
whroeder1 2011.07.18 18:08  
  1. amirbabak:
    how to code a combo box for input parameters?
    Buttons & Textfields on mt4 chart possible now - MQL4 forum
  2. I want to add Time Frames, to be selective...(M1-M5-...MN1)
    Just use a string and let the user enter M1 or H4, parse the string in init
    extern string TF.M1_M30_H1_MN1 = "H1";
    int TF.selected=0;
    int init(){
        int     TFperiod[]  = { PERIOD_M1,  PERIOD_M5,  PERIOD_M15, PERIOD_M30,
                                PERIOD_H1,  PERIOD_H4,  PERIOD_D1,  PERIOD_W1,
                                PERIOD_MN1  };
        string  TFtext[]    = { "M1",       "M5",       "M15",      "M30",
                                "H1",       "H4",       "D1",       "W1",
                                "MN1"       };
        for(int index=ArraySize(TFtext)-1; index >= 0; index--){
            if (TF.M1_M30_H1_MN1 == TFtext[index]) TF.selected = TFperiod[index];
        }
    }
    

Seyed AmirBabak Teymourian
123
Seyed AmirBabak Teymourian 2011.07.18 19:45  
WHRoeder:
  1. amirbabak:
    how to code a combo box for input parameters?
    Buttons & Textfields on mt4 chart possible now - MQL4 forum
  2. I want to add Time Frames, to be selective...(M1-M5-...MN1)
    Just use a string and let the user enter M1 or H4, parse the string in init


thanx dear WHRoeder for the Link and Code.

therefore it's not possible to do it(making a Combo Box for input parameters), as SDK said.

lp7631010
4
lp7631010 2011.07.19 05:10  

good!

lp7631010
4
lp7631010 2011.07.19 05:11  

Content removed

Luis
226
Luis 2014.12.16 18:15  
I dont know how the input list has not been created..
Carl Schreiber
5951
Carl Schreiber 2014.12.16 18:59  
amirbabak:

how to code a combo box for input parameters?

for example, I want to add Time Frames, to be selective...(M1-M5-...MN1)

You can use mt4's enum:

// prices:
input ENUM_APPLIED_PRICE Prc = PRICE_CLOSE;
// time-Frames
input ENUM_TIMEFRAMES TF = PERIOD_M5;
...

or you even define you own 'combo box' by enum:

enum __in{ 
   _p1, // value 1
   _p2, // value 2
   _p3, // value 3
   _p4  // value 4 
};
extern __in check = _p1;
/
To add comments, please log in or register