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.
- amirbabak:Buttons & Textfields on mt4 chart possible now - MQL4 forum
how to code a combo box for input parameters? - 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]; } }
- amirbabak:Buttons & Textfields on mt4 chart possible now - MQL4 forum
how to code a combo box for input parameters? - 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.
good!
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;
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
how to code a combo box for input parameters?
for example, I want to add Time Frames, to be selective...(M1-M5-...MN1)