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
Sometimes it seems that many or some people here have confused fanaticism and reality, what is desirable and what is possible.
Instead of taking a shovel and digging, there is a sophisticated flaunting of the shovel theme: "and maybe here on the edge so sharpen it", "with maybe here a corner twist".... Everything ends at the level of the shovel.
Because of the necessity to use switch, the whole point is lost. If that's the case, you can do without unnecessary fiddling, just a different array for objects of each type. So, "the king is naked".
This is a demonstration that a sheet can contain objects of any type. Plus each type can be dynamically identified if it includes additional information about its type. This "additional information" is a weak link, but unfortunately MQL doesn't provide tools for type control, so we can't do without it. If anyone knows a better solution: please submit the code, it will be interesting to see it.
As if your comment hints that you have not dealt with the pattern "template method")))
1. This is a demonstration that a sheet can contain objects of any type.
2. Your comment hints that you haven't dealt with the "template method" pattern)))
1. That's nice, of course. But what's the use of it?
2. Yes. And...? Did I lose a lot? This is again a conversation about how to "sharpen" or "bend" something with a shovel.
1. That's nice, of course. But what good is it?
2. Yes. And...? Did I lose a lot? This is again a conversation not on the merits but on the subject of how to "sharpen" or "bend" something there at the shovel.
I have also managed to put different objects into one array, and note that it is more clear, because there is nothing extra:
So what? Nothing. Overloading does not work, you need to register the type, then through switch. That's all the joy.
What are the "patterns" we're talking about here? Is it someone who imposed his way of thinking and everyone dances? Why are these patterns elevated to such a high rank?
What was the task? What was to be done? I thought you asked to show how different classes work with one node.
I have also managed to put different objects into one array, and note that it is more clear, because there is nothing extra:
So what? Nothing. Overloading does not work, you need to register the type, then through switch. That's all the joy.
Nothing extra? Your classes are 100% redundant. All cl1 methods and data are almost completely duplicated by cl2 class, while base is empty.