New to mql language
I'm getting: 'iclose' - cannot convert enum' error on this line of code:
h = iHigh(_Symbol, _Period, iHighest(_Symbol, _Period, iClose(_Symbol, smoothTimeframe, 0), trendPeriod, 0));(Symbol(), PERIOD_M1, 0)
any help appreciated!
int trendPeriod = 10; // just example fill with 10 ENUM_TIMEFRAMES smoothTimeframe = PERIOD_CURRENT; double h = iHigh(_Symbol, _Period, iHighest(_Symbol, _Period, iClose(_Symbol, smoothTimeframe, 0), trendPeriod, 0)); //;(Symbol(), PERIOD_M1, 0) <---- In this section you wrote the code incompletely. I comment here.
You must declare the enumeration for the timeframe in the global or local variable section so that your timeframe parameters are valid.
int trendPeriod = 10; // just example fill with 10 ENUM_TIMEFRAMES smoothTimeframe = PERIOD_CURRENT; double h = iHigh(_Symbol, _Period, iHighest(_Symbol, _Period, iClose(_Symbol, smoothTimeframe, 0), trendPeriod, 0));
Did you bother to try your "solution" ?
Doesn't make sense. You also need to read the documentation.
h = iHigh(_Symbol, _Period, iHighest(_Symbol, _Period, iClose(_Symbol, smoothTimeframe, 0), trendPeriod, 0));(Symbol(), PERIOD_M1, 0)
this is your code
int iHighest( const string symbol, // Symbol ENUM_TIMEFRAMES timeframe, // Period ENUM_SERIESMODE type, // Timeseries identifier int count=WHOLE_ARRAY, // Number of elements int start=0 // Index );
this is iHighest code in documentation
You have to define ENUM_SERIESMODE which can be like MODE_OPEN then two int parameters for count and start.
so it should be like
h = iHigh(_Symbol, _Period, iHighest(_Symbol, _Period, MODE_CLOSE, trendPeriod, 0));
this is your code
this is iHighest code in documentation
You have to define ENUM_SERIESMODE which can be like MODE_OPEN then two int parameters for count and start.
so it should be like
Thank you for explaining Arpit - much more helpful than the mods on here. Your fix worked and I understanD why now so much appreciated!
Glad to know your issue is solved. I given you answer in layman term, however other mods have a nature of helping in a way which make learners develop self problem solving skills so you grasp the root cause of your question next time you may explore documentation which will help you learn fast and reduce your number of general question posts in forum.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New to mql language
I'm getting: 'iclose' - cannot convert enum' error on this line of code:
h = iHigh(_Symbol, _Period, iHighest(_Symbol, _Period, iClose(_Symbol, smoothTimeframe, 0), trendPeriod, 0));(Symbol(), PERIOD_M1, 0)
any help appreciated!