enum blahblah { A, B, }; input blahblah Blah = A;
Hossein Zandi:
thanks alot
Hossein Zandi:
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.
Duplicate topic deteted.
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.

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Symbol Properties
- www.mql5.com
To obtain the current market information there are several functions: SymbolInfoInteger(), SymbolInfoDouble() and SymbolInfoString(). The first parameter is the symbol name, the values of the second function parameter can be one of the identifiers of ENUM_SYMBOL_INFO_INTEGER, ENUM_SYMBOL_INFO_DOUBLE and ENUM_SYMBOL_INFO_STRING. Some symbols...
lippmaje:
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.
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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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