Sort sequence of closed and canceled orders in the history pool (MT4)

 

Hi,

in the MQL4 Reference under  MQL4 Reference/Trade Functions/OrderSelect I found the following two sentences:

Consecutive selection of orders using the SELECT_BY_POS parameter returns information in the sequence in which it was received from the trading server. Sorting of the resulting list of orders cannot be guaranteed.

 

 As consequence I have to examine each order in the history pool if I want to select some orders with a close time within a certain time range.

Question: is this correct?

 If you have several thousands orders in the history this will slow down the whole process.

 Am I completely wrong here? Any ideas how to improve the search for orders have been closed within a certain time range? 

Example:

I want to get all orders which have been closed during the last 24 hours. Must I really iterate through all orders in the history pool??

Thanks

Matthias/Bobcat 

 
Yes you have, what's the problem ?
 
Alain Verleyen:
Yes you have, what's the problem ?

Thank for your answer.

The problem is (or might be) that iteration through all orders in the history pool is time consuming and seriously degrading the performance.

The number of the orders can be very huge. Or am I wrong here?

Matthias/Bobcat 

 
Dr Matthias Hammelsbeck:

Thank for your answer.

The problem is (or might be) that iteration through all orders in the history pool is time consuming and seriously degrading the performance.

The number of the orders can be very huge. Or am I wrong here?

Matthias/Bobcat 

For each problem there is at least 3 solutions, so you should not worry about hypothetical problem.