Errors, bugs, questions - page 978

 
voix_kas:

To improve programming purity I would like to ask the public about this.

Suppose there is a flag (bool Flag) declared globally. When certain events/conditions occur, it must be set to a certain value.

The first variant:

Second option:

Which option:

1. faster in terms of performance?

2. If I may say so, "more professional"?

This section of code is supposed to get control quite often, e.g. every tick.

And in your opinion, every tick is often?

There are about 3-5 million such comparisons in one tick; the CPU will even not notice your conditions.

But if you are going to compare several thousand per tick, then it's worth optimizing.

In general, there is a profiler for speed optimizing purposes.

 

Questions 1 and 2 on the condition as below:

if (A==1 || B==2 || C==3)
{  // некие действия
}

1) If condition A==1 is true, will B and C be checked next? Or without checking B and C "some kind of action" is done.

2) Does the check go from left to right (A, B, C) or vice versa (C, B, A)?

3) How can the code be profiled on weekends when there are no ticks?

 
paladin800:

Questions 1 and 2 on the condition as below:

1) If condition A==1 is true, will B and C be checked next? Or without checking B and C "some kind of action" is done.

2) Does the check go from left to right (A, B, C) or vice versa (C, B, A)?

3) How can I try code on a weekend when there are no ticks?

1. if the first condition is true, then the following ones will not be checked. it is an "or" condition

2. from left to right

3. stimulate through timer setting, e.g.

 

Either my skis aren't working, or it's my fault...

void OnStart()
  {
   int intDATA[];ArrayResize(intDATA,10);ArrayInitialize(intDATA,0);
   Print(string(sizeof(intDATA)));

   int doubleDATA[];ArrayResize(doubleDATA,10);ArrayInitialize(doubleDATA,0.0);
   Print(string(sizeof(doubleDATA)));

   int intD=0;
   Print(string(sizeof(intD)));

   double doubleD=0.0;
   Print(string(sizeof(doubleD)));
  }

2013.04.29 15:28:17    Size (EURUSD,D1)    8   //верно
2013.04.29 15:28:17    Size (EURUSD,D1)    4   //верно
2013.04.29 15:28:17    Size (EURUSD,D1)    52 //должно быть 8*10=80?
2013.04.29 15:28:17    Size (EURUSD,D1)    52 //должно быть 4*10=40?

 
joo:

Either my skis aren't working, or it's my fault...

The sizeof from an array gives the size of a descriptive block of the array, not the size of the array. To get the array size, you should do sizeof(element)*ArraySize()
Документация по MQL5: Операции с массивами / ArraySize
Документация по MQL5: Операции с массивами / ArraySize
  • www.mql5.com
Операции с массивами / ArraySize - Документация по MQL5
 
Renat:
The sizeof from an array gives the size of the descriptive block of the array, not the size of the array. To get the size of an array, do sizeof(element)*ArraySize()
Thank you.
 
Help! Chart and statistics are no longer displayedhttps://www.mql5.com/ru/signals/5894
 
necroslav:
Help! Chart and statistics are no longer displayedhttps://www.mql5.com/ru/signals/5894
The broker cleared the trading history for some reason. You need to ask him questions.
 
Rosh:
For some reason the broker cleared the trading history. You need to ask him questions.

in the terminal itself I still have the story. Surely the problem is with the broker?

p.s. It's back on again... strange

 
Hello, the signals tab in MT4 is gone, was there in the morning, came in the evening and it's gone. And now the request is not executed, what should I do?
Reason: