there are no trading operations - page 4

 

I confirm this code, it doesn't work, although everything is correct ! 

 
Vladimir Pastushak:
 if(OrderSend(Symbol(), OP_BUY, NormalizeDouble(lot, 2),  NormalizeDouble(Ask, Digits()) … < 0)
  1. You ignored my advice about NormalizeDouble and lotstep. #24 Prices from the terminal do not need to be normalized.

 
William Roeder:
  1. Perhaps you should read the manual. OrderSend does not return a bool.

Vladimir Pastushak is checking if its < 0 actually 

if(OrderSend(Symbol(), OP_BUY, NormalizeDouble(lot, 2),  NormalizeDouble(Ask, Digits()), m_deviation, 0, 0,  "Comment", 0, 0, clrBlue) < 0)
 
William Roeder:
  1. Perhaps you should read the manual. OrderSend does not return a bool.
       How To Ask Questions The Smart Way. 2004
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

  2. Check your return codes, and report your errors. Don't look at GLE/LE unless you have an error. Don't just silence the compiler, it is trying to help you.
              What are Function return values ? How do I use them ? - MQL4 programming forum
              Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles

  3. You ignored my advice about NormalizeDouble and lotstep. #24 Prices from the terminal do not need to be normalized.

Lorentzos Roussos:

Vladimir Pastushak is checking if its < 0 actually 

https://www.mql5.com/en/forum/350461/page3#comment_18194245

Please Help
Please Help
  • 2020.09.07
  • www.mql5.com
Please Help What is the solution to this problem ?? Please help and thank you...
 

I got exactly the same error message from last week, whenever I try to release a new version.

After failing, it got validated later automatically without any action. Strange!!!

Today again I got the same error message while uploading new version. Now waiting for auto validation as before. !!!!

 
Afsal Meerankutty:

I got exactly the same error message from last week, whenever I try to release a new version.

After failing, it got validated later automatically without any action. Strange!!!

Today again I got the same error message while uploading new version. Now waiting for auto validation as before. !!!!

it logs the error and then passes validation you mean . I think this may be the new norm 

 
Lorentzos Roussos:

it logs the error and then passes validation you mean . I think this may be the new norm 

Yes. It logs exactly the same error and then I give up after trying multiple times.

But the next day I got the notification saying , 'Prodcut validation completed'.

It got validated automatically without errors. May be MQL5 team have validated it from their side.

Don't know what is happening. Now also my last version is not validated is not completed due to the same error.

 
Afsal Meerankutty:

Yes. It logs exactly the same error and then I give up after trying multiple times.

But the next day I got the notification saying , 'Prodcut validation completed'.

It got validated automatically without errors. May be MQL5 team have validated it from their side.

Don't know what is happening. Now also my last version is not validated is not completed due to the same error.

So it does not validate again ? 

Any chance its an actual error ?

 

I started having this problem now trying to update my product  version 

I don't know what is causing this problem, all previous versions have been successfully validated and this error has only just started to appear.

I have already reviewed all the code that has about 4 thousand lines, I have tried everything. EA works perfectly in testing and updating is a small adjustment in 2 lines of code that do not affect the overall functionality at all.

I've tried to set the lot at 0.01, I've tried to generate random orders when it's not in the real market to try to pass the tests and nothing.

Finally I tried to validate the previous version that had already passed the tests and to my surprise it gave the same error ie the code that had already been successfully validated presented this problem now.

I don't know what was changed in the EA's validation algorithm but they should be more transparent.

I contacted the customer service and they simply sent me to ask on the forum. I found it very disregard.

 

So what was the solution to this ? wait 24hours and if its not validated try again ?

Edit :  this passes validation standalone .Will test with scanners.

#property version   "9.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer
  // EventSetTimer(60);
  sim_tr=0;
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
int sim_tr=0,sim_lm=50,ot_magic=03567,sim_slip=1000,sim_tp=1000,sim_sl=1000;
void OnTick()
  {
//---
  //IN TESTER 
  if(IsTesting())
  {
  sim_tr++;
  if(sim_tr==sim_lm)
   {
   int errors=0;
   ResetLastError();
   int mot=OrdersTotal();errors+=GetLastError();
   int cot=(int)AccountInfoInteger(ACCOUNT_LIMIT_ORDERS);errors+=GetLastError();
   double lot=(double)MarketInfo(Symbol(),MODE_MINLOT);errors+=GetLastError();
   int ilim=(int)(SymbolInfoInteger(Symbol(),SYMBOL_TRADE_STOPS_LEVEL)*1.6);errors+=GetLastError();
   double mfol=MarketInfo(Symbol(),MODE_MARGINREQUIRED);errors+=GetLastError();
   int lodigs=LotDigits(lot);errors+=GetLastError();
   lot=NormalizeDouble(lot,lodigs);
   if(mfol<AccountFreeMargin()&&errors==0)
   {
   int rando=(int)MathRand()%2;
   //sell 
   if(rando<1&&mot<cot)
     {
     if(sim_sl<=ilim){sim_sl=ilim*2;}
     if(sim_tp<=ilim){sim_tp=ilim*2;}
     double StopLoss=Bid+sim_sl*Point();
     StopLoss=NormalizeDouble(StopLoss,Digits());
     double TakeProfit=Bid-sim_sl*Point();
     TakeProfit=NormalizeDouble(TakeProfit,Digits());
     int tick=OrderSend(_Symbol,OP_SELL,lot,Bid,sim_slip,StopLoss,TakeProfit,NULL,ot_magic,0,clrBlue);
     }
   //buy
   if(rando>=1&&mot<cot)
     {
     if(sim_sl<=ilim){sim_sl=ilim*2;}
     if(sim_tp<=ilim){sim_tp=ilim*2;}     
     double StopLoss=Ask-sim_sl*Point();
     StopLoss=NormalizeDouble(StopLoss,Digits());
     double TakeProfit=Ask+sim_sl*Point();
     TakeProfit=NormalizeDouble(TakeProfit,Digits());     
     int tick=OrderSend(_Symbol,OP_BUY,lot,Ask,sim_slip,StopLoss,TakeProfit,NULL,ot_magic,0,clrRed);
     }
   }
   sim_tr=0;
   }  
  }
  //IN TESTER ENDS HERE    
  }
//Find Lot Digits 
int LotDigits(double lot)
{
int returnio=0;
double digitos=0;
double transfer=lot;
while(transfer<1)
{
digitos++;
transfer=transfer*10;
} 
returnio=(int)digitos;
//Print("Lot ("+lot+") Digits "+digitos+" Returnio "+returnio);
return(returnio);
}
void OnDeinit(const int reason)
  {
  sim_tr=0;
  }

It works on scanners too . 

Note to sellers : Dont ever [ever never] use MQLInfoInteger to detect if you are in tester . 

Reason: