Product verification failed. It run my robot on a wrong pair

Hc Chung  
s

I wanted to launch my product, but it cannot pass verification.


The test run my robot on NZDUSD and failed by having no operations.

However, my robot  is designed for EURUSD.

How can I have the test run on pair EURUSD only?


My Error file is attached.

<<<<<<<<<<<<<  Updates

I added the following code to limit it to single currency EURUSD

int symbolCmp = StringCompare("EURUSD", Symbol(), false);
if (symbolCmp!=0)  return;

<<<<<<<<<<<<<  Updates

I found a few ways to fix the errors froms the forum discussion

https://www.mql5.com/en/forum/188949

Productivity - USA - MetaTrader 5 Help
Productivity - USA - MetaTrader 5 Help
  • www.metatrader5.com
The productivity index measures the output produced for each hour of labor worked. This indicator is useful for predicting inflation and output growth. If the cost of labor increases respective to the increase of productivity, and, moreover, if the increase in production costs is unlikely, then it will not cause inflation. It has a significant...
Files:
Kenneth Parling  
Hc Chung:

I wanted to launch my product, but it cannot pass verification.


The test run my robot on NZDUSD and failed by having no operations.

However, my robot  is designed for EURUSD.


How can I have the test run on pair EURUSD only?

then your verification will never pass because verification test your code on various symbols. It's better you make your robot work with for example EurUsd also even if it's designed for NzdUsd only. Simply don't restrict your ea to only one symbol (in your case NzdUsd). The most proper way, don't even use that kind of restriction!

Hc Chung  

My EA has passed the verification.

I added NormalizeDouble for each Lots, Stop-Loss, Take-Profit.  A few functions were also added:

CheckVolumeValue(), IsNewOrderAllowed() and OrderModifyCheck().    

For example,

BLots = NormalizeDouble(BLots,Digits);
BLots=  CheckVolumeValue(BLots,ordermsg);

//+------------------------------------------------------------------+
//| Check the correctness of the order volume                        |
//+------------------------------------------------------------------+
double CheckVolumeValue(double volume,string &description)
  {
//--- minimal allowed volume for trade operations
   double min_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MIN);
   if(volume<min_volume)
     {
      description=StringFormat("Volume is less than the minimal allowed SYMBOL_VOLUME_MIN=%.2f",min_volume);
      volume=min_volume;
      //return(false);
     }

//--- maximal allowed volume of trade operations
   double max_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MAX);
   if(volume>max_volume)
     {
      description=StringFormat("Volume is greater than the maximal allowed SYMBOL_VOLUME_MAX=%.2f",max_volume);
      volume=max_volume;
      //return(false);
     }

//--- get minimal step of volume changing
   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("Volume is not a multiple of the minimal step SYMBOL_VOLUME_STEP=%.2f, the closest correct volume is %.2f",
                               volume_step,ratio*volume_step);
      volume=ratio*volume_step;
      //return(false);
     }
   description="Correct volume value";
   //return(true);
   return volume;
  }

Keith Watford  
Please edit your post and post the code using the code button (Alt+S)
Hc Chung  
Hc Chung:

My EA has passed the verification.

I added NormalizeDouble for each Lots, Stop-Loss, Take-Profit.  A few functions were also added:

CheckVolumeValue(), IsNewOrderAllowed() and OrderModifyCheck().    

For example,

BLots = NormalizeDouble(BLots,Digits);
BLots=  CheckVolumeValue(BLots,ordermsg);

//+------------------------------------------------------------------+
//| Check the correctness of the order volume                        |
//+------------------------------------------------------------------+
double CheckVolumeValue(double volume,string &description)
  {
//--- minimal allowed volume for trade operations
   double min_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MIN);
   if(volume<min_volume)
     {
      description=StringFormat("Volume is less than the minimal allowed SYMBOL_VOLUME_MIN=%.2f",min_volume);
      volume=min_volume;
      //return(false);
     }

//--- maximal allowed volume of trade operations
   double max_volume=SymbolInfoDouble(Symbol(),SYMBOL_VOLUME_MAX);
   if(volume>max_volume)
     {
      description=StringFormat("Volume is greater than the maximal allowed SYMBOL_VOLUME_MAX=%.2f",max_volume);
      volume=max_volume;
      //return(false);
     }

//--- get minimal step of volume changing
   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("Volume is not a multiple of the minimal step SYMBOL_VOLUME_STEP=%.2f, the closest correct volume is %.2f",
                               volume_step,ratio*volume_step);
      volume=ratio*volume_step;
      //return(false);
     }
   description="Correct volume value";
   //return(true);
   return volume;
  }
Hc Chung  

After a few months, my revised product again failed with errors - There are no trading operations

test on EURUSD,H1 there are no trading operations test on NZDUSD,H1 there are no trading operations test on GBPUSDcheck,M30 there are no trading operations test on XAUUSDcheck,Daily there are no trading operations

although it run well on my screen.

Like many users discussed  https://www.mql5.com/en/forum/188949 .

I have tried every possible way

there are no trading operations
there are no trading operations
  • 2017.03.31
  • www.mql5.com
I test me EA on my own broker it works okay...
Allan Munene Mutiiria  
/////////////////////////////////////////////////////////////////////////////////////////////
   // THERE ARE NO TRADING OPERATIONS --- SOLUTION >>>>>>>>>>  TRADING VOLUME CHECK FOR VALIDATION
   /////////////////////////////////////////////////////////////////////////////////////////////
   
        double maxVolume  = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MAX);
        double minVolume  = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN);
        double volumeStep = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP);
        
        if (lots < minVolume) Print("   Volume less than volume_min, returning now"); return 0;
        if (lots > maxVolume) Print("   Volume bigger than volume_max, returning now"); return 0;
        
   /////////////////////////////////////////////////////////////////////////////////////////////
This should work perfectlty to solve the problem. The 'lots' is a double value used somewhere else in my code extract. However, the necessary code is as displayed. Hope this helps. 
Reason: