Troubled by the error there are no trading operations - page 4

 
Alexey Viktorov:

The computer is an idiot. © M.M. Botvinnik.

So, pretend to be an idiot and try to pass the algorithm from the point of view of an idiot and with the parameters set by an idiot. It is from this point of view that the autovalidator fits. Pay attention to the "feedback". Does the Expert Advisor notify you about errors?

I finally figured it out, maybe someone can help, in general, the Soviet has only when the MM was checked for a minimum lot, and so hardcore set lot = 0.01, well, in the validator deposit turns out to be $ 1 (found this information in one of the topics), respectively, it uses lot 0.001 (or so) to trade and because I always had in one place was lot 0.01, respectively, he did not have enough money and the robot does not trade)

 
Roman Gergert:

I finally figured it out, maybe someone will help, in general, the board only when the MM was checked for a minimum lot, and so hardcore set lot = 0.01, well, in the validator deposit turns out to be $ 1 (found this information in one of the topics), respectively, it uses the lot 0.001 (or so) to trade and because I always had in one place a lot of 0.01, respectively, he did not have enough money and the robot does not trade)

I would like to bring it up again. Your answer does not help me. I have a volume calculation and if everything does not fit the minimum volume is used:

SymbolInfoDouble(symbol, SYMBOL_VOLUME_MIN)

In the end, put the minimum volume at once without any calculations. Then comes the margin check... and no trading operations.

Yesterday I stumbled upon a forum answer saying that sometimes one and the same code can be sent after some time and it will pass. Time passed, it does not send.

What to do, 2 weeks ago this volume detection function went through and since then it hasn't changed in any way!!!

 
Evgeniy Scherbina:

I would like to bring it up again. Your answer doesn't help me. I have a volume calculation, and if everything doesn't fit then the minimum volume is used:

In the end, put the minimum volume at once without any calculation. Then comes the margin check... and no trading operations.

Yesterday I stumbled upon a forum answer saying that sometimes one and the same code may be sent after some time and it will pass. The time has passed, it doesn't send.

What to do, 2 weeks ago this volume detection function went through and since then it hasn't changed in any way!!!

I'm going to be an old-timer. With such a rating, numbers under the avatar, and having a problem you somehow did not see the topic where it was discussed. And that's where the solution was found.

Автоматический валидатор - проблемы
Автоматический валидатор - проблемы
  • 2019.04.26
  • www.mql5.com
Пытаюсь обновить версию советника и получаю ошибку. Тот же советник в тестере стратегий. Паралельно пишу советники и для MT4, там все ОК...
 
Alexey Viktorov:

I'm going to be an old-timer. With such a rating, numbers under the avatar, and having a problem you somehow did not see the topic where it was discussed. And there you have found a solution.

Among the peoples of Russia there are those who pray to pagan gods, and those answer
 
Evgeniy Scherbina:
Among the peoples of Russia there are those who pray to pagan gods, and those who answer

I answered, but I am not a pagan god. I think this is a temporary solution to the problem, hopefully it will be fixed soon.

 
Note - this comment is probably more for myself the next time I look for the "there are no trading operations" error.
Used ForceStop in doubtful places. Further it will appear in the report as division with zero and the exact location of this error.
Example in my case:
//+------------------------------------------------------------------+
//|  Проверяет объем ордера на корректность                          |
//+------------------------------------------------------------------+
int ForceStop=0;
int sstop=0;
bool CheckVolumeValue(double volume,string &description)
  {
  
//--- минимально допустимый объем для торговых операций
   double min_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MIN);
   if(volume<min_volume)
     {     
      description=StringFormat("Volume is less than the minimum allowable SYMBOL_VOLUME_MIN=%.2f",min_volume);
      sstop=5/ForceStop; // force stop, zerro divide
      return(false);
     }

//--- максимально допустимый объем для торговых операций
   double max_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MAX);
   if(volume>max_volume)
     {
      description=StringFormat("Volume is greater than the maximum allowable SYMBOL_VOLUME_MAX=%.2f",max_volume);
      sstop=5/ForceStop; // force stop, zerro divide
      return(false);
     }

//--- получим минимальную градацию объема
   double volume_step=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_STEP);

   int ratio=(int)MathRound(volume/volume_step);
   if(MathAbs(ratio*volume_step-volume)>0.0000001)
     {
      description=StringFormat("The volume is not a multiple of the minimum gradation SYMBOL_VOLUME_STEP=%.2f, Closest correct volume %.2f",
                               volume_step,ratio*volume_step);
      sstop=5/ForceStop; // force stop, zerro divide
      return(false);
     }
   description="Correct value of volume";
   return(true);
  }
 

Bro, it helped me to move all the variables into the code header.

void OnDeinit

{
Alert(GetLastError());

}

And in the ResetLastError() init;

I don't know what worked, but something like this

 

It helps me to simply change (edit) a few lines in the code.
Or just add blank lines, and recompile again.

I think it's some kind of bug on the server.

 
Taras Slobodyanik:

Or just add blank lines, and recompile again.

Confirmed, sometimes just recompile and it works.

 
Nauris Zukas:

Confirmed, sometimes just recompile and it passes.

It's not because I recompiled it, it's because the test started from a different date. And I noticed such a bug, if you slip something that has already been, then testing does not happen, and immediately gives the previous test result. So, do not be fooled by such crutches. Try to make it normal. If something is missing or parameters are invalid, report it via Print and everything will be correct.

Reason: