MQL5 EA Product Validation Errors Daily Feed - page 3

 
Syed Oarasul Islam:

I tried it. After replaced Ontick() with OnStart() then it passed. But when I tried with Ontick() the second time it failed. Am I missing something? Do I have to submit when it passed and the try to with a different file name? This solution sounds strange but if it works then I am speechless :D

Replace OnTick, send for validation. When it's passed, replace OnTick back and send the file with different name again.

We were shocked, but it worked.

 
Evgeniy Machok:

Replace OnTick, send for validation. When it's passed, replace OnTick back and send the file with different name again.

We were shocked, but it worked.

It did not worked. I tried exactly the you way you said. Tried even few times. No lucks.

 
Evgeniy Machok:

https://www.mql5.com/ru/forum/312005/page2#comment_11478327

Comment #16 -

The solution is really weird but has successfully worked for me. Thanks.

 
Nitin Raj:

The solution is really weird but has successfully worked for me. Thanks.

Can you please explain how did you proceed step by step? 

 
Syed Oarasul Islam:

Can you please explain how did you proceed step by step? 

Just two simple steps:

Replace OnTick with OnStart: passed the validation.

Now replace OnStart with OnTick: passed the validation and published. 

I didn't change any file name. 

 
Nitin Raj:

Just two simple steps:

Replace OnTick with OnStart: passed the validation.

Now replace OnStart with OnTick: passed the validation and published. 

I didn't change any file name. 

Okey I will try one more time.

 
Nitin Raj:

Just two simple steps:

Replace OnTick with OnStart: passed the validation.

Now replace OnStart with OnTick: passed the validation and published. 

I didn't change any file name. 

Not working for me.

 
Syed Oarasul Islam:

Not working for me.

Perhaps You have a problem in something else, please post a screenshot of the error

In the screenshot you published, the EA does not have enough money, this situation must be properly processed and warn the user
 
Denis Nikolaev:

Perhaps You have a problem in something else, please post a screenshot of the error

In the screenshot you published, the EA does not have enough money, this situation must be properly processed and warn the user
bool CheckMoneyForTrade(string symb,double lots,ENUM_ORDER_TYPE type)
  {
//--- Getting the opening price
   MqlTick mqltick;
   SymbolInfoTick(symb,mqltick);
   double price=mqltick.ask;
   if(type==ORDER_TYPE_SELL)
      price=mqltick.bid;
//--- values of the required and free margin
   double required_margin=RobotsAccountInfo.MarginCheck(symb,type,lots,price);
   double free_margin=RobotsAccountInfo.FreeMargin();
   //--- call of the checking function

   //--- if there are insufficient funds to perform the operation
   if(required_margin>free_margin)
     {
      //--- report the error and return false
      Print("Not enough money for ",EnumToString(type)," ",lots," ",symb," Error code=",GetLastError());
      return(false);
     }
//--- checking successful
   return(true);
  }

After checking this function on every places where my EA tries to submit trades I realize the "Not Enough Money" error was not there anymore but then it started to show new error which is Log File Size Exceeded

log files size exceeded 2059 MB, test terminated
Files:
error.png  12 kb
 

Avoid endless loops of trying to order / printing to the logfile.

The answer should be self explanatory, when it say's that your logfile becomes to big how about trying to solve that first ?