Features of the mql5 language, subtleties and tricks - page 284

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
Thanks to this chip, it is possible to write such constructions.
Result.
Thanks to this chip, it is possible to write such constructions.
Result.
Why do you need "Macros" and can't use standard MQL with templates and function pointers ?
What macros brings you ?
Why do you need "Macros" and can't use standard MQL with templates and function pointers?
For each task, I choose the tool that is optimal for its solution.
What do macros give you?
My code in kodobase rarely does without macros. In most cases, it is an indispensable necessity.
I choose the best tool for each task.
My code in kodobase rarely does without macros. In most cases, it is an indispensable necessity.
Still, there is an unanswered question.
It is clear when it is about code compatibility for two terminals, but in other cases - what is the point?
It's clear when it's about code compatibility for two terminals, but in other cases - what's the point?
To have a constructive discussion, you need to give an example of something you don't understand. I applied it above.
I needed to search for combinations of input parameters of the TS for the Tester. And for each combination to run optimisation.
That's why it was necessary to make several nested for-cycles. Well, in order to see the number of the variant and the combination of current inputs, there is a printout.
Accordingly, I made it through a macro. To conveniently (with one line) set the change of one of the TC parameters in the set.
It seems to have worked out optimally. After all, other tools are no better for solving the problem.
To have a constructive discussion, you have to give an example of something you don't understand. I applied it above.
I needed to search for combinations of input parameters of the TS for the Tester. And run optimisation for each combination.
Therefore, it was necessary to make several nested for-cycles. Well, in order to see the number of the variant and the combination of current inputs, there is a printout.
I cannot discuss your code constructively - it is too costly for my brain to understand it.
I just wonder if this is a trick, a style, a love, or a demonstrative sign of coolness. No one seems to use macros so actively anymore.
I'm not criticising, just wondering... Is it always easy for you to read other people's code?
Accordingly, I made it through a macro. To conveniently (with one line) specify a change of one of the TC parameters in a set.
It seems to have worked out optimally, because other tools are not the best way to solve the problem.
I don't know, I would do external change through settings or file.... I mean, the idea that changing settings requires recompilation is a bit strange to me.
I just wonder if it's a trick, a style, a love, or a demonstrative sign of coolness. No one seems to use macros so actively anymore.
It's just a solution to the task at hand. If macros are better, I use macros. Perhaps I set tasks a bit non-standard, that's why the solutions come out like this.
I'm not criticising, I'm just curious... Do you always find it easy to read other people's code?
I rarely read other people's code. Very rarely. For example, I don't understand Generic library but I use it. CTrade is very easy. In both cases, the authors are MQ.
I don't know, I would do external modification via settings or file..... I.e. the very idea that changing settings requires recompilation is a bit strange to me.
For example, you have several variants of OnTester, and you want to do optimisation for each one. That's the kind of code you need for such purposes, when there are many OnTester variants.
This is how it works.
My OnTester depends on multiple parameters (highlighted). Adding a new parameter to the enumeration is one line.
The task is non-standard. That's why the solution is like this. As you can see, it is convenient.
It's just a solution to the task at hand. If macros are better, I use macros. Perhaps, I set some non-standard tasks, that's why I get such solutions.
It turns out that you are not looking for an option to use macros on purpose.
The task is non-standard. That's why the solution is such. As you can see, it is convenient.
I rather perceive such a case as a crutch, a temporary solution when you don't want to change the code but need to check something or fix a bug. Perhaps I'm wrong.
You have helped to dispel the idea that you just like to use such non-standard solutions.
It turns out that you are not specifically looking for an option to use macros.
When I see a lot of repetitions while solving, I automatically think how to do it better. It can be functions, OOP, pointers to functions, templates, macros, ArraySwap and so on.
I rather perceive such a case as a crutch, a temporary solution when you don't want to change the code but need to check something or fix a bug. Perhaps I am wrong.
Automating the Tester in a few lines with a simple script. I.e. it takes thousands of times less time/effort to write it and further edits than a manual routine.
Helped dispel the thoughts that you just like to use such out-of-the-box solutions.
I don't like programming. Have to force myself to do it.
I don't like programming. I have to force myself.
What is your favourite activity?