Errors, bugs, questions - page 2225

 

Somehow I missed the point or have already forgotten:

are object values returned normally on the shared hosting?

i.e. if the strategy uses lines, can I get the value of those lines on the virtual hosting meta-quotes?

 
Nikolai Semko:

It won't help. Especially if the timer is already on before being enabled in the class, e.g. at intervals of a few hours or days. Then such a class will ruin the entire logic of the program.

Ideally, all work with timer must be wrapped in a class, and all parts of a program where timer is needed, must use it through this class.

Otherwise, it is impossible to keep track of it.

 
Andrey Khatimlianskii:

Ideally, all timer work should be wrapped in a class, and all parts of the program that need a timer should use it through that class.

Otherwise, it's impossible to keep track of it.

wisely

 
Nikolai Semko:

sensible

It would make sense to do this at platform level and let us run multiple timers for different needs )

 
Andrey Khatimlianskii:

Ideally, all timer work should be wrapped in a class, and all parts of the program that need a timer should use it through that class.

Otherwise you won't be able to keep track of it.

And in this class you may defeat the OnTimer, EventSetMillisecondTimer, EventSetTimer, EventKillTimer, as it was done by Faber in Init_Sync.mqh. And then full control. Good idea. Thank you.

 
Nikolai Semko:

You can add OnTimer, EventSetMillisecondTimer, EventSetTimer, EventKillTimer to this class, as Faber did in Init_Sync.mqh. And then full control. Good idea. Thanks.

Looking forward to KB ;)

 
Andrey Khatimlianskii:

It would make sense to do this at platform level and allow us to run multiple timers for different needs )

Right...
That would be much easier. But easy ways are for guys, and husbands don't look for easy ways :))

 
Andrey Khatimlianskii:

Looking forward to the QB ;)

I hope to get my hands on it someday...

 
Dmitri Custurov:

I've tried both feng shui and this - the result is the same. The thing is that everything works 99% of the time, and I need 100%. At the moment, the main thing for me is to get the logic right, and I'll be able to do the beauty later.

I forgot to add only that the error mentioned above appears in the tester. When I open it on a chart, I don't notice it or I just need to wait for the required extremum where the error will occur again.

The real ones need to be compared correctly

/*!
   \brief   Сравнение вещественных double
   \return true в случае равно, иначе false
*/
bool CompDouble(const double a_one,const double a_two) {
   if(fabs(a_one - a_two) <= DBL_EPSILON * fmax(fabs(a_one), fabs(a_two)))
      return true;    // числа равны с относительной точностью DBL_EPSILON
//---
   return false;
}
/*!
   \brief   Сравнение вещественных float
   \return true в случае равно, иначе false
*/
bool CompFloat(const float a_one,const float a_two) {
   if(fabs(a_one - a_two) <= FLT_EPSILON * fmax(fabs(a_one), fabs(a_two)))
      return true;    // числа равны с относительной точностью FLT_EPSILON
//---
   return false;
}
 
Thanks for the tip. It's working. I was already worried about OrderSelect.
Reason: