![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
Know what you are doing. At first you seem to have just decided to put together a class with everything you have, to find some universal approach when dealing with warrants. But you are solving a very specific task.
Yes, because only one cycle fills the structure, and after that you have to start the cycle again to find the required element, if the number of elements you need is more than 1, the number of cycles will be more than 1
Yes. Whichever way you look at it. Whichever way you look at it, that's the way it will be.
If we need to find only two orders with the highest price, we will have two loops, and if we need 3, we will have 3 loops. Of course, we don't have to sort everything.
Yes. Whichever way you look at it. Whichever way you look at it, that's the way it will be.
If we need to find only two orders with the highest price, we will have two loops, and if we need 3, we will have 3 loops. Of course, we don't have to sort everything.
In the first post it says , find two maximum orders by type , find two minimum orders by type , find two last orders by type and find two first orders by type.
I did everything in one cycle...
This is the usual maximum search, we only need two variables. First, we check with one variable; if it is larger, we flip the value from it to the second variable and not to the new value. If it is not more, then we compare it with the second one. It's like a usual search for the maximal value, only a bit more complicated.
I know how to do that...
The question is another...
We are now using a class member of the Buy.Price_Max.Price type that has several components
Buy all about the buy order
Price_Max all about the maximum order
Price Price is the price of the maximal order
I know how to do that...
The question is another...
our code now uses a member of the Buy.Price_Max.Price class which has all the following components
Buy all about the buy order
Price_Max all about the max order
Price price of the maximal order
What is the question? What to store the values in is not so crucial.
The question is to find the fastest and most stable method ...
That's because they've already found the fastest one. One cycle, two checks. But only remember one ticket. After the cycle, select the order on the ticket and take all its properties.