[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 246

 
BBSL:

eddy said he didn't mean to offend anyone

I said I didn't give a shit :D I'll behave properly even if it offends someone because it's their problem. but it's for their benefit, so they can solve the problem and find the cause and eventually eradicate it, otherwise there will always be problems.
 
Ais:

One reason to do everything in one file -> https://docs.mql4.com/ru/basis/variables/formal:

"It is possible to pass parameters by reference. In this case the modification of such parameters will affect the corresponding variables in the called function passed by reference. You cannot pass elements of arrays by reference. Parameters by reference can only be passed within a single module, this is not possible for library functions. "


Yes, maybe that's the problem...

I have many functions where one of the parameters is an array passed by reference...

I.e. you have to abandon multi-file program structure to avoid problems, can't it be solved differently?

 
Bicus:

Gentlemen, here's a question.

I am running the EA in the tester. The EA has access to the history, i.e. it is looking for one of the last, let's say, 20 closed orders.

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 have you solved this problem?

Modern computers perform hundreds of millions of operations per second.

How many transactions must 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/semi-month.

 
eddy:
i actually said that i don't give a fuck :D i will behave properly even if it offends someone because it's their problem. but it's for their benefit, so they want to solve the problem and start looking for causes and eventually eradicate them, otherwise there will always be problems.


eddy, the concept of right is very subjective))

If a group of people think that something is generally accepted and right, then that is the rule for that group of people. There is such a group on this forum.

It's all very well that you have your own view of the world, but to spend time discussing it and all the more changing or re-educating people is a very big luxury))

Arguing about the correctness of ideas is a waste of resources and our issues are not resolved.

I propose, with all due respect to you and understanding your ideas, return to programming)))

 
tmt0086:
Hi =) I just wrote an EA... there are no conditions, just opening on GBPUSD and EURUSD. So, when testing, it does not close GBPUSD orders when standing on EURUSD. And vice versa. Can you set it up? So, it will open orders... I can't do it on the demo, but I can't test it.

Somebody tell me...
 
Sergey_Rogozin:

In your "difficult" case, you can introduce a condition that the orders will only be replayed in the last month/semester.

What conditions?

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

Am I wrong?

 
tmt0086:

Somebody tell me...

There is no multi-currency strategy tester in MT4.
 
BBSL:


eddy, the notion of right is very subjective))

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 rule requires it. i have studied rules and correctness all my life
 
Roman.:

There is no multi-currency strategy tester in MT4.

Can you tell me where I can test it? Will it work on MT5?
 
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?


No. Here is an example of selecting the freshest closed order from the order history for further working with it...

//---Поиск последнего отработавшего ордера для открытия очередной позиции ---
   
   for (orderIndex = (OrdersHistoryTotal() - 1); orderIndex >= 0; orderIndex--)
   {   
      if (!OrderSelect(orderIndex, SELECT_BY_POS, MODE_HISTORY))
      {
         Print("Ошибка при доступе к исторической базе (",GetLastError(),")");
         continue;
      }
   
      if ((OrderSymbol() != Symbol()) || (OrderMagicNumber() != MagicNumber))
      {
         continue;
      }
      
        
   //-------------------------Принимаем в расчет только ордер, закрытый недавно-----------------------
if(time<OrderCloseTime())     //(сравниваем его с хранящимся в пероеменной time) 
  {
    time=OrderCloseTime();     //если время закрытия ордера больше - ложим его в переменную
         
         
     
         int lastType = OrderType();
         double lastLots = OrderLots();
         double lastProfit = OrderProfit() + OrderSwap();
.....
.....
.....