Errors, bugs, questions - page 2330
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I've roughly figured out the reason. I have a global variable.
Something with the initialization order of mcl environment and mission apparently, if actobjects a pointer and put an array there myself, nothing crashes. Class in global variables - bad practice, of course, I'll rewrite. But problems will arise with static arrays in functions (in µl the rule - initialization at first entry into function doesn't work).
In general, if it counts as a bug, then knowing approximately the cause, I can probably localize it.
Anyway, if it counts as a bug, knowing roughly the cause, I can localise it I guess.
Nah, can't catch it, disappears miraculously after cutting out code. Even commenting out some lines (which don't execute before the crash) affects it.
There is a long code class, which lies in mqh. We need to create exactly the same class, which differs from the original one only in two lines (instead of less sign there should be more sign).
Can this be done without creating another almost identical mqh?
When the class is short, you can easily make it with a multi-line macro and everything comes out easy. But the code here is long.
I don't want to create an mqh-clone because if I fix one mqh, I will have to repeat all my actions in the second one. In addition, there is the human factor of forgetfulness and inattention.
You can still do it with a template class. But it is not at all obvious how it will affect the speed of execution. The class is needed for quick runs.
#ifdef
It won't work. Both classes must be in operation.
It won't work. Both classes should be in operation.
I don't see a problem.
_____________
inheritance
putting differences into separate small classes
I don't see a problem.
_____________
inheritance
Putting differences into separate small classes
There are several decent sized methods in a class. In each method you only need to replace the ">" sign with a "<" sign.
You can use a virtual like thisBut, unfortunately, we still need to pass the class initializing value. So I guess we'll have to use a template after all.
I'd pass some adapters via template parameters (shouldn't be any brakes there), but if you want to be so clumsy, you can too. Make a hard link to the header file (mklink /H <link> <target>, if I'm not mistaken. You can google "windows create hard link"). And then enable this stuff in the usual way
I'd pass some adapters via template parameters (shouldn't be any brakes there), but if you want to be so clumsy, you can too. Make a hard link to the header file (mklink /H <link> <target>, if I'm not mistaken. You can google "windows create hard link"). And then you just plug it in the usual way.
You're missing the point.
You do not understand the question.
Well, I don't know, are you sure you understand me? Just in case the listing is qq.mqh and ee.mqh (one entity, changing one changes the other)
All as ordered, class not inmacros, almost the same except _M.