Errors, bugs, questions - page 858

 
By the way, do leap seconds have any effect on the time in the dates?
 

Here is the situation: we have a date structure and at one stage we either add days or hours or minutes or months to it and end up with negative values like -335.05.2012 00:-615:00 (or in case we add January 650, 360 hours and 250 minutes). They need to be converted to a normal date. So far I have come up with this.

void ReconstructTimeStruct(MqlDateTime &sTime)
  {
   while(sTime.min<0)
     {
      sTime.min=59-fabs(sTime.min);
      sTime.hour--;
     }
   while(sTime.min>=60)
     {
      sTime.min=sTime.min-60;
      sTime.hour++;
     }

   while(sTime.hour<0)
     {
      sTime.hour=23-fabs(sTime.hour);
      sTime.day--;
     }
   while(sTime.hour>=24)
     {
      sTime.hour=sTime.hour-24;
      sTime.day++;
     }

   while(sTime.day<1)
     {
      if(sTime.mon>1)
        {
         sTime.mon--;
         sTime.day=GetDaysInMonthByMonthAndYear(sTime.mon,sTime.year)-fabs(sTime.day); //GetDaysInMonthByMonthAndYear получает количество дней в месяце с учетом  месяца и високосный ли год
        }
      else
        {
         sTime.mon=12;
         sTime.year--;
         sTime.day=GetDaysInMonthByMonthAndYear(sTime.mon,sTime.year)-fabs(sTime.day);
        }
     }
   while(sTime.day>GetDaysInMonthByMonthAndYear(sTime.mon,sTime.year))
     {
      if(sTime.mon<12)
        {
         sTime.mon++;
         sTime.day=sTime.day-GetDaysInMonthByMonthAndYear(sTime.mon,sTime.year);
        }
      else
        {
         sTime.mon=1;
         sTime.year++;
         sTime.day=sTime.day-GetDaysInMonthByMonthAndYear(sTime.mon,sTime.year);
        }
     }
   while(sTime.mon<1)
     {
      sTime.year--;
      sTime.mon=12-fabs(sTime.mon);
     }
   while(sTime.mon>12)
     {
      sTime.year++;
      sTime.mon=sTime.mon-12;
     }
  }

I do not know either I am a fool or the skis do not fly. sometimes gets stuck and on the month does not work correctly.

can anyone tell me what the problem is?

Or who can tell me the algorithm for finding the opening time of a candle by date, including unformed candles, with the possibility of shifting (0-current candle, -1 - candle on the left, 1 - candle on the right)?

 
leksiq: I don't know how to tell the developers about the error, I'll try here...
You have a ServiceDesk section in your profile.
 
Urain:

Exactly, but I would do it differently... So if the condition worked, there is no need to do another check.

Most of the years will pass through the first check as false,

Actually, a normal compiler won't check the rest of the && if the first condition is false.

I don't know about it in ME5.

 
papaklass:

Is the Warehouse service planned to be created for the foursome?

I join the question - it is possible that 4 will also survive 5 - it's like XP and VISTA
 
A100:

In general, normal compiler if the first condition is false - the rest of && will not check

but I don't know how it is in ME5.

Same way. short condition checks.

// In four long (full)

 
MetaDriver:

// In a foursome long (full)

Then it's clear where the legs are coming from
 

MetaTrader 5 Client Terminal build 712

[...]

8. Terminal: Signals. Fixed display of signal information and hanging navigation between signals when working under Wine.

[...]

They have broken something in the terminal in the latest build. Now it hangs on its own after several seconds after start ( pipe wait ) and is killed only through the system monitor. The 695 and 705 builds worked flawlessly but overall they were fine. I've got Linux mint 12 ( lisa ), wine-1.4. Here is the OS terminal log attached. May help. Terminal MT itself doesn't leave any logs -- after deletion via monitor the logs folders are empty.

I would like to see update with possibility to turn off, e.g. via command line switch like '/noupdate'. Then at least it would be possible to work somehow before the next crash.

Files:
crash9log.zip  2 kb
 

OnTesterInit

The OnTesterInit() function is the handler of the TesterInit event that is automatically generated before the start of the Expert Advisor optimization in the strategy tester.

So, this function is called only when Optimization=CustomMax ?

At first I thought from the description that it is always called from the Strategy Tester... Too bad it is not...

 
Roffild:

OnTesterInit

The OnTesterInit() function is the handler of the TesterInit event that is automatically generated before the start of the Expert Advisor optimization in the strategy tester.

So, this function is called only when Optimization=CustomMax ?

I first thought from the description that it's always called from the tester... Too bad that's not the case...

What does Optimize=CustomMax mean ?

Describe what you miss. What would you like to get?

Reason: