[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 247

 
Bicus:

What are the conditions?

It is impossible to sort the history in the tester. The last order falls at the very bottom. You have to scroll through ALL the history to get to it.

Am I wrong?

We should add in the block/function for searching of orders:

if(OrderCloseTime()>start) {

where start = month/semi-month... https://docs.mql4.com/ru/dateandtime/Month
 
Sergey_Rogozin:

Modern computers perform hundreds of millions of transactions per second.

How many trades would it take for the computer to start slowing down?

In your "difficult" case, you can specify the condition, according to which the order search will be performed only for the last month/half of the year.


Also 2Bicus:

Gentlemen, here's a question.

I am running the EA in the tester. The EA has a history, i.e. it is looking for one of the last 20 closed orders, for example.

This is very easy in a real EA: we can specify the period of history during which the orders should be shown. Thus, the last orders are always "above". But, the more trades we have in the tester, the more orders are closed and the larger their list has to be looked through and the slower the Expert Advisor starts working.

Anyway, how has anyone solved this problem?

We can use the loop to handle only, say, 30 last closed orders for analysis and decision making (see my post above).

 
tmt0086:

Can you tell me where I can test it? will it work in MT5?
I would write in an indicator, "virtual trades" so to speak
 
tmt0086:

Can you tell me where I can test it? Will it work on MT5?

Yes.
 
eddy:
there are objective rules and therefore correctness. there is also the importance of rules and the hierarchy of rules. if a rule is less important than another or hierarchically lower, it should be disregarded if a more important rule requires it. i have studied rules and correctness my whole life


Objective rules are possible only in the case of acceptance, agreement of subjects of a group to them. But if another group of subjects doesn't accept these rules, then they are no longer objective for the total group consisting of the sum of the two groups.

If you and I don't close this argument, you and I will be banned, let's just stick to our opinions and do our programming, ok?

 
eddy:
I would write in an indicator, "virtual trades" so to speak

could you be more specific? a link or something, thanks)
 
Roman.:

Yes.

Thank you, I will try to convert the EA in MT5.
 
Roman.:


no. Here is an example of selecting the most recently closed order from the order history to work with it later...

for (orderIndex = (OrdersHistoryTotal() - 1); orderIndex >= 0; orderIndex--)

What's that? It's going through all the orders of history, isn't it? It is clear that the body of the loop can somehow be limited by dates, etc.

What I meant in my question was, is there any trick to store only the last few closed orders in the tester's history, i.e. the way it is done in the real history?

 
tmt0086:

Could you be more specific? A link or something, thanks)
i may have already done so, but i have not seen it. i just had my idea. you can simply count all the bars and make virtual trades in the process.
 
Bicus:

What's that? It's going through all the orders of history, isn't it? It is clear that the body of the loop can somehow be limited by dates, etc.

What I meant in my question was, is there any trick to store only the last few closed orders in the tester's history, i.e. the way it is done in the real history?


Ahhhhhhhh... I see. :-))) I'm not familiar with such trickery :-)))
Reason: