![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
Personally, I wrote myself a long time ago a class CStructWrapper, inherited from CObject (CMyObject is actually the same, with additional debugging fields), and for sorting I use a standard function.
If I need an array of structures, I declare a derived class based on this template. In it, I declare a function for comparing the necessary fields of the structure. And then - I use a standard class of an array of objects with sorting.
Created objects can be copied directly from structures using assignment operator. If necessary, I copy them.
Unfortunately, I'm not so much experienced in OOP that I could understand your code.
Unfortunately, I'm not yet strong enough in OOP to understand your code.
It's just a class that contains our structure inside.
And all sorts of copy operators, allowing to use the assignment sign (=) directly between the object and the structure.
When I need an array of structures - I create an array of such objects. Each one has the required structure. In addition, a comparison function is defined in this class, which is necessary for sorting and searching. All, then standard functions of CArrayObj class are used
Unfortunately, I'm not yet strong enough in OOP to understand your code.
Well, implement the method without OOP. Don't worry, you can take "quick sorting" method from SB( there are a lot ofsorting algorithms, someone uploaded a video like visualization of different algorithms, everyone is better in some situation, but this one is optimal and most widely used) and change it for your structure, here you should choose, by which field of structure you will compare more vs less. approximately like this (say, by some stringyour_value)
Unfortunately, I'm not yet strong enough in OOP to understand your code.
But at least you're good at distinguishing *** from ***?
Unfortunately now even the methods that fxsaber suggested don't work anymore.
And I'm looking for methods of sorting an array of structures. Does anyone have any working variants ?
I think such a workaround to the language limitation would work.
But at least you're good at distinguishing *** from ***?
Just like people... I think you have me confused with someone else...
So do people... I think you have me confused with someone else...
That's the thing: I think I am. But I'm not.
That's the thing, it "seems". But I'm not confused.
What's all this "friction" about? What does it have to do with the subject?
What's the point of all this "friction"? What does this have to do with the subject?
Why? Is there a separate topic for this?
Well, implement the method without OOP. Don't go too far, take the "quick sort" method from SB
I think such a workaround to the language limitation will do.
Thanks, friends!
Got it into my hole.