Try SMA?
Try
extern ENUM_MA_METHOD MaMethod=MODE_SMA;
GumRai:
Yes. Thanks
Try
honest_knave: By the way, you will get on better declaring these as integers not doubles.
Don't use doubles. Don't use integers. | extern double MaMethod = MODE_SMA; extern double MaApplied = PRICE_CLOSE; |
Use the proper enumerations. | extern ENUM_MA_METHOD MaMethod = MODE_SMA; extern ENUM_APPLIED_PRICE MaApplied = PRICE_CLOSE; |
I was equally referring to the erroneous declaration of MaPeriod and MaShift as doubles. Enumerations are effectively 4 byte integers
honest_knave: Enumerations are effectively 4 byte integers
| Not in the GUI sheriffonline: Value as "0.0" instead of "MODE_SMA"
|
WHRoeder:
Don't use doubles. Don't use integers. | |
Use the proper enumerations. |
I am Newbie and learning MQL4. ofcourse i learnt lot, but still confused with Enumerations!
can you send me sample code for Enumearion?
Definetely i can get idea what mistake i have done?
I tested following example code! but says error message "Variable not Defined"?
enum months // enumeration of named constants { January, February, March, April, May, June, July, August, September, October, November, December };
January will have 0 but 1! , Feb.=1,... Dec=11
So you have to add 1!
sheriffonline: I tested following example code! but says error message "Variable not Defined"?
enum months // enumeration of named constants { January, February, March, April, May, June, July, August, September, October, November, December }; | That is the definition. same as int or double. Define a variable.months aMonth = February;
|
gooly: January will have 0 but 1! , Feb.=1,... Dec=11
So you have to add 1! | No you don't. Set the value you want.enum months // enumeration of named constants { January = 1, February, // Value will default to 2 March, ... |
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
No Error while compiling. but in settings it took Value as "0.0" instead of "MODE_SMA"
what will be the issue?