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

 
Martingeil:

In my opinion, this function lacks the closing time of the last profitable trade.

Without it, all losing trades in the history are recalculated, not only the last ones.

So, it should be like this:

                if(OrderCloseTime()>LastProfitOrderTime) {
                  if(OrderProfit()>0) {LastProfitOrderTime=TimeCurrent(); break;}
                  if(OrderProfit()<0) losses++;
                 }

Isn't it?

 
if I have to divide by 0 in the loop, will the calculation stop? the loop will not continue?
 
eddy:
If I have to divide by 0 in the loop, will the calculation stop? The loop will not continue?
To avoid such variants I always put a condition before formulas (when value is in the denominator) if(value != 0) then the formula.
 

I have them too, but to exclude 0 you have to write lots of them everywhere.

so what is the answer to the question?

 
eddy:

I have them too, but to exclude 0 you have to write lots of them everywhere.

So what's the answer to the question?

In the logbook it will always say "Division by 0". And no action ....

Only the loop knows what's going on in the loop itself))))

The Expert Advisor will not work.

 
so I'll have to write a lot -_-
 
Why do they often write Symbol() instead of NULL in functions? e.g. iClose(Symbol(), TF, i)
 
eddy:
Why do they often write Symbol() instead of NULL in functions? e.g. iClose(Symbol(), TF, i)
They do it the way they prefer. They can also write "EURUSD" more specifically.
 
sergeev:
so nothing will happen. The function Funk2 - does not return any value. it is void
Can you make it non- void? It returns 1 of the parameters and simply assigns the 2nd
 
Tonight I optimised an EA on minutes with a test period of 5 years. Internet was not connected. In the morning after internet connection I repeated the test and got different results. Every time Metatrader is connected, are all quotes updated or only the missing ones?