[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 963

 
Techno:
you have to find another way to analyse, graphical functions are very slow
I have removed everything as you said and the speed has increased by 60-70%, but now it is harder to see which order is where on the chart. And I have not yet applied Igor's advice with if.
 
volshebnik:
I removed everything as you said and the speed has increased by 60-70%, but now it is more difficult to see which order is where on the chart. And I have not yet applied Igor's advice with if.
If will not give great performance, only a couple of clock cycles. Tell us exactly what you want to display on the chart, we may think how to do it without performance loss
 
Techno:
If will not give you much performance, just a couple of calculations. Tell us exactly what you want to put on the graph - we can think how to do it without performance loss


if(NormalizeDouble(Bid,Digits)<=NormalizeDouble(TL_TPdown[B],Digits)

? A couple of cycles? The question is not even about the numerical number, but about the optimization of calculations - there is information about the full calculation of conditions in mql4 - it has been repeatedly written on the forum

in mql5, a reduced calculation of conditions has already been implemented.

 
Techno:
If won't give you much performance, just a couple of clock cycles. Tell me exactly what you want to put on the graph, we can think about how to do it without losing performance
Ideally, I need the numbers of market orders with their signs of difference from other orders at the moment of their opening. I understand that you can set them in real time and remove them during testing. It's just more convenient and again - faster to see what opened correctly and what didn't.
 
IgorM:


if(NormalizeDouble(Bid,Digits)<=NormalizeDouble(TL_TPdown[B],Digits)

? a couple of cycles? The question is not even about the numerical number, but about the optimization of calculations - there is information about full calculation of conditions in mql4 - it has been repeatedly written on the forum

in mql5 a reduced calculation of conditions is already implemented

yes it's understandable, but by priority we must first decide what prevents the Expert Advisor from testing...
 
Techno:
yes it is, I see, but on the priority should first decide what prevents the expert to test...


well, if by priority, it is enough to make a copy of the EA - in the copy delete all Comment(), Print() and graphics, and everything into the tester for optimisation, finding approximate parameters, start testing year by year, and then assemble the final version with graphics

I did so

 
Good morning, I am still trying to find out when the last order was closed in relation to the current bar. The idea is to prohibit the EA to make a deal if the position was closed during the current bar. In some cases, it opens a new order right after the stop loss. If I look at the code I am using, it does not seem to be the right one. I would like to thank you in advance.
for(int e1=1;e1<OrdersHistoryTotal();e1++)
   {
    if(OrderSelect(e1-1,SELECT_BY_POS,MODE_HISTORY)==true)
      {
         if(OrderSymbol()!=Symbol()){continue;}
         int Cl_time=OrderCloseTime();
         if(Cl_time>Time[0])
            {
              Trade=False; 
            }
            else
            {
             Trade=true;
            }
      }
   }
 
IgorM:


the chart is sure to slow down

And do not forget that in mql4 there is a full calculation of conditions in if(), i.e. if you have several && then all values will be calculated and compared, although one false is enough to make construction with && be false

it is possible to split it into several if()

in this case, after the first if() has not been executed, the whole structure below will not be considered

Igor, thank you! I missed something here... ((((( I didn't keep track of everything ( Your variant gave a speed increase of 35%. Total together with "cleaning" graphics and + if the speed has almost doubled - about 125-130% - that's already something.
 
Why does the tester's speed drop towards the end of the third year pass ?
 
volshebnik:
Why does the speed of the tester drop towards the end of the third year pass ?
is there an overshoot of historical orders?
Reason: