How to set dropdowns for inputs
-
I want to create dropdown menu in the input field for my EA. the EA uses two different trading models. Model 01 and model 02. User should be able to select a trading model and test the EA / Trade the EA.
Can you guy give me a advice to how to do it?
-
You will see how to achieve in here: https://fxdreema.com/shared/NTqgifSme
-
thanks for the reply brother,
I used it this way, but there is no drawdown in the input menu



-
The enum value has to be at the top of the constants list.
-
@jstap brother, I looked your example, it was for MT4.
I'm asking for MT5. I'm sorry for not mentioned it earlier.Can you show me a example please. (MQL5)
-
It is the same, just create exactly the same but for mt5
-


Still not works bro... why is that ?.
-
You'll have to add a shared link to see what's not working
-
-
Without looking further, where is your enum? recreate with the same priciples as what I showed:

-
https://fxdreema.com/shared/3bLzDAAie
Compilation error occurs.
-
You are not calling and using the correct constant;

-
I want to create like this type of dropdown for my inputs brother.

-
That is what you have done, everything in the {curly brackets} is what you get in the dropdown.
-
A recap - :
- I created an enumeration with "enum" keyword in "constant" window / menu.
- then I entered values as {Model01,Model02}
tests :
I tested it, there is no dropdown in inputs of EA.
I have no idea what's wrong here.
-
@jstap Bro... thank you... Finally, I got it... I got one last question.
Should we assign value for "TM" here? is there any effect "TM" value being different from the "enum" values...?
-
TM was just my name, you can call it whatever you want. The TM value is how to call your dropdown value.
-
No, I mentioned that the value we assign to the "TM" (or any name) always should be a value of the enumeration we created. is it?.
I also curious to know the name (data type) of the "Trading_Model" (in this case) we assigned in the data type field. -
In that field (TM) you can only use one of your enum list values, but you can try to see if it's another but it will return false. By creating an enum list you create an independent type, which is needed to refer to the dropdown list value.
-
Thanks a lot brother... now I know how to create and use enumeration because of you... thanks a lot...