MT version archive. - page 5

 
Roman:

This is not a crutch, but a recommended practice from the developers.
I found this function in the description of the while loop

A thought occurred to me: if this function terminates program execution correctly, why not use it for TesterStop()?
It is a pity it does not work for TesterStop(), we will know about it now.
But it is fair to ask developers if functionIsStopped() must work for function TesterStop()?
Maybe it is a bug?

But the main thing is that we have found a solution to the problem.

I did not say that it does not work. I said that TesterStop() requires that the test has already been running for some time. )))

Maybe after that it will work too...
 
Сергей Таболин:

I didn't say it didn't work. I said that TesterStop() requires that the test has already been running for some time. )))

Maybe after that it will work too...

Got it now.

 
Сергей Таболин:

I understand everything and I don't need crutches. And I had to look for a crutch here read for what.

It's possible. But I don't recall anyone complaining about it.

Can I have an explanation?

//+------------------------------------------------------------------+
double OnTester()
{
   if(tester_stop) return(нужное вам значение);

   остальной код
}

What is the rest of the code? What is this code executing?

 
Alexey Viktorov:

Can I explain?

The rest of the code, what is it? What in this code is executed?

Personally, I have a balance sheet growth stability calculation going on there. ))) As I said before, I'm going to open a discussion on this topic.

And in general, anything can be counted there.

 
Roman:

This is not a crutch, but a recommended practice from the developers.
I found this function in the description of the while loop

That is why I had an idea: if this function checksthe fact of forced program termination, why not use it for TesterStop().
It is a pity it does not work for TesterStop(), we will know about it now.
But it is fair to ask the developers ifIsStopped() function must work for TesterStop() function?
Maybe it is a bug?

But most importantly, a solution to the problem has been found.

This function is intended to terminate such loops. Forced termination of a program is closure of an Expert Advisor window or closing of the terminal itself. If you start an infinite loop without checking IsStopped() function, the loop remaining in memory will continue working. The value returned by IsStopped() allows to break the loop when the terminal is closed. In other cases it is useless, as far as I understand.

 
Сергей Таболин:

Personally, I have the calculation of balance sheet growth stability going on there. ))) As I said before, I'm going to open a discussion on this topic.

And in general, you can calculate anything there.

But the value returned by OnTester is processed somewhere, isn't it?

You can read anything, but how and where to use the calculated value is another question.

 
Alexey Viktorov:

But the value returned by OnTester is processed somewhere, isn't it?

You can read anything, but how and where to use the calculated value is another question.

It is used as a result of optimization...


 
Сергей Таболин:

This is used as a result of optimisation...


This is not a use, it is a display of the result of the optimisation.

 
Alexey Viktorov:

It's not the usage, it's displaying the result of optimization.

OnTester() calculates this result. And usage... I use it to evaluate the optimization...

 
Сергей Таболин:

OnTester() calculates this result. And usage... I use it to evaluate the optimization...

But judging by this piece of code

//+------------------------------------------------------------------+
double OnTester()
{
   if(tester_stop) return(нужное вам значение);

   остальной код
}
the value returned from this function must be processed somehow. What good is returning "minus many nines" if there is no reaction to it in further code?
Reason: