Errors, bugs, questions - page 846

 
Tell me, is there a function that can send a position for further work (modification) using , ulong deal; // Ticket deal, if it is made by the ticket of the deal, remembered earlier? Probably, such a choice would require some complex algorithm - like left hand to brush the right ear?
 
Dimka-novitsek:
Tell me, is there a function that can send a position for further work (modification) using , ulong deal; // Ticket deal, if it is made by the ticket of the deal, remembered earlier? Probably, this choice will require some complex algorithm, like the left hand brushing the right ear?
Each trade has a position identifier. Using this identifier, we will try to search for the position itself.
 

Good evening everyone! I see people are interested in this branch. About the championship...

Still not checked my data sent from the closed information for the championship, although the expert - checked!

When will they be checked?

 
Leo:

Good evening everyone! I see people are interested in this branch. About the championship...

Still not checked my data sent from the closed information for the championship, although the expert - checked!

When will they be checked?

If the robot is checked without errors, no need to worry. As far as I understand, the expert is checked automatically, but the personal data is checked manually.
 
Leo:

Good evening everyone! I see people are interested in this branch. About the championship...

Still not checked my data sent from the closed information for the championship, although the expert - checked!

When will they be checked?

It has been advised elsewhere: if there are any questions, a registered competitor can easily write about their problem in the "Discussion" section of their championship page. The message will reach the addressee much faster than through the forum.
 

I have a question.

There is a piece of code from the article that defines the start of a new bar.

   static datetime Old_Time;
   datetime New_Time[1];
   bool IsNewBar=false;

// копируем время текущего бара в элемент New_Time[0]
   int copied=CopyTime(_Symbol,_Period,0,1,New_Time);
   if(copied>0) // ok, успешно скопировано
     {
      if(Old_Time!=New_Time[0]) // если старое время не равно
        {
         IsNewBar=true;   // новый бар
         if(MQL5InfoInteger(MQL5_DEBUGGING)) 
            Print("Новый бар",New_Time[0],"старый бар",Old_Time);
            Old_Time=New_Time[0];   // сохраняем время бара
        }
     }
   else
     {
      Alert("Ошибка копирования времени, номер ошибки =",GetLastError());
      ResetLastError();
      return;
     }

//--- советник должен проверять условия совершения новой торговой операции только при новом баре
   if(IsNewBar==false)
     {
      return;
     }

Everything works fine. But I want to include calculation of different heavy statistics into the last if. I want to have minimum calculations at the moment of a new bar.

Here is my question. How this code will behave if the statistics are calculated for a relatively long time (say, 2 seconds) and the gap between the ticks of the old and the new bar is minimal.

As far as I understand, whileOnTick() function is calculating ticks will be skipped but will the next tick be new for the EA, although it is not the first in the bar.

The manual check has not worked out yet

Документация по MQL5: Основы языка / Функции / Функции обработки событий
Документация по MQL5: Основы языка / Функции / Функции обработки событий
  • www.mql5.com
Основы языка / Функции / Функции обработки событий - Документация по MQL5
 
St.Vitaliy: How this code will behave, if the statistics is read for a relatively long time (say 2 seconds)
If the OnTick() function is executed for 2 seconds, then all quotes that come during this period will be ignored by the Expert Advisor. This is the point you wanted to clarify? A "new" quotation for the Expert Advisor will be a quotation that arrives immediately after the OnTick() function is executed, even if this quotation is not the "first tick on the bar".
 
Yedelkin:
If the OnTick() function is executed for 2 seconds, then all quotes that come during this time interval will be ignored by the EA. Is this the point you wanted to clarify?

Here, these 2 seconds are ignored (and the ticks during this time), but on the third tick, for example, another tick will come and the code will perceive it as new in the bar?

This is indirectly confirmed by the fact that when I run the EA, the next tick is always the first.

If the statistics is calculated for 90 seconds, the condition for a new tick on M1 will be executed at least once?

 
Yedelkin:
Each trade has a position identifier. Use this identifier to search for the position itself.
Thank you!!!
 
St.Vitaliy: Here, these 2 seconds are ignored (and the ticks during this time), but on the third one, for example, another tick will come and the code will accept it as a new tick in the bar? Indirectly it is proved by the fact, that when I run the EA, the next tick is always the first. I ask a different question, if the statistics will be calculated for 90 seconds, will the condition for a new tick on M1 ever be fulfilled?

Well, I've already finished it above. Let me repeat: the "new" quote for the Expert Advisor is a quote that arrives right after the next execution of the OnTick() function, even if this quote is not the "first tick on the bar". The condition of a new bar coming is checked only after the Expert Advisor finishes the processing of that "previous" bar.

if(Old_Time!=New_Time[0])

will be checked only after the Expert Advisor finishes the processing of the quote that came on the "previous" bar. ...If the OnTick() function is executed for 90 seconds and is started at 00.00.00, the "condition for a new tick on M1 will be executed at some point", namely after 00.01.30.

Reason: