Features of the mql5 language, subtleties and tricks - page 223
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
How about this?
I can't test it.
Don't check.
QuickSort library here
The QuickSort library is here
Thanks, that's a very good option! I seem to have QuickSort too, but for some reason it's wildly slow.
Your option could be wrapped in macros somehow to make it faster to use...
Thanks, that's a very good option! I seem to have QuickSort as well, but for some reason the brakes are wild.
Your option could be wrapped in macros to make it faster to use....
I don't see why you need macros. It's very simple as it is.
how to properly format something that looks like this in C:
int sort(void *arr,size_t isize,size_t size, int (*cmp)(void *item1,void *item2)); /// типовой прототип sort с функцией сравнения
???
trying to sort through templates:
template <typename T>
int sort(T &arr[],int (*cmp)(const T &,const T&))
{
}
doesn't work - you can't put a function pointer into the argument. There must be a separate typedef
but typedef can't (or can it??) be a template.
macroms grow out of these problems :-)
how to properly format something that looks like this in C:
int sort(void *arr,size_t isize,size_t size, int (*cmp)(void *item1,void *item2)); /// типовой прототип sort с функцией сравнения
???
We're trying to use templates:
fails - you can't put a function pointer in the argument. There must be a separate typedef
but typedef cannot (or can it??) be a template....
macroms grow out of these problems :-)
I discovered an unobvious feature of MQL (and C++)
That is, the default value is substituted into the parameter (p) at the point of method call (p.f1()) and this value is taken from the method description in class C1 - the declared type of variable ptr, not the real type of object obj.
(Which, in general, is logical).
Forum on trading, automated trading systems and testing trading strategies
Errors, bugs, questions
Andrey Dik, 2022.06.24 08:38
MQL_VISUAL_MODE is a special case of MQL_TESTER?
MQL_OPTIMIZATION is a special case of MQL_TESTER?
I mean, MQL_TESTER includes both MQL_VISUAL_MODE and MQL_OPTIMIZATION?
I need the EA to perform some actions when working on a chart and in visual mode, but not in all other cases. I can't figure out how to select the right flags for this case when checking MQLInfoInteger()?
I could do it very simply, for example, like this:
if (MQLInfoInteger(MQL_VISUAL_MODE) || MQLInfoInteger(MQL_CHART_MODE))
{
//выполняем некоторые действия
}
but the MQL_CHART_MODE flag is not provided in mql5.
does anyone have any thoughts?
Anybody have any thoughts?
if (ChartID()!=0) {
// Graphical chart presents
// draws on it
}
if (ChartID()!=0) {
// Graphical chart presents
// draws on it
}
What does that mean? Can you expand on that?