how to define parameters that users can choose value from DropDownList
enum blahblah { A, B, }; input blahblah Blah = A;
thanks alot
hi
I define like :
enum RiskPercent { 1,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2 }; input RiskPercent Risk = 1;
but it makes an error:
'1' - cannot convert enum
-
Don't double post! You already had this thread open.
General rules and best pratices of the Forum. - General - MQL5 programming forum 2017.07.19 -
Perhaps you should read the manual.
Input Variables - Variables - Language Basics - MQL4 Reference
How To Ask Questions The Smart Way. 2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
enum ENUM_RISK_PERCENT { RISK_10=10, // 1.0 RISK_11=11, // 1.1 ... RISK_20=20, // 2.0 }; input ENUM_RISK_PERCENT InpRisk = RISK_10; // Risk in Percent double Risk = (double)InpRisk*0.1;You cannot define an enum with floating point values, only int. But you can transform the enum into the right percentage range. The comments will give all inputs the proper label.
- www.mql5.com
You cannot define an enum with floating point values, only int. But you can transform the enum into the right percentage range. The comments will give all inputs the proper label.
thanks alot
it worked correctly
hi every one
I want to define an extern parameter in an EA and I want put some value on it like:
1
1.1
1.2
1.3 , ....
that user can select one of them from DropDownList how I can do it?
Best Regards
Neda