How to resolve "no trading operations" validation failure?

 
I tried updating the MT4 version of the EA that was listed on MQL5, but it kept failing validation with a "no trading operations" message.



I tested it by:
1. Re-uploading the old EA that had passed validation and was already listed.
2. Creating a simple EA that ensured "trading operations" for various pairs and various time frames (from M1 to Daily).

The result was the same: the EA failed validation and continued to display the "no trading operations" message.
Below, I've included the code for the simple EA I used for testing. I'd like to ask my fellow admins and more experienced coders to help me identify the error in the code that causes validation to fail and always display the "no trading operations" message.

Thank you in advance.

//+------------------------------------------------------------------+
//|                                                    MinimalEA.mq4 |
//|                                       Copyright 2026, Test26.com |
//|                                           https://www.Test26.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2026, Test26.com"
#property link      "https://www.Test26.com"
#property version   "2.03"
#property strict
#define   EAName       "EA_Test_V2"
#property description   EAName
//---------------------------------------------------------
input int      Mgc   = 12345;//Magic Number
input double   Lots  = 0.01;
input double   TP    = 400;
input double   SL    = 200;

int Cb = _Digits==3?10:1;//Calibration for 3 Digits Price
string   myDes = "";//Volume Value Description
//+------------------------------------------------------------------+
//| Expert initialization & deinitialization function                |
//+------------------------------------------------------------------+
int  OnInit(){
if(!TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)) return(INIT_FAILED);
                                                 return(INIT_SUCCEEDED);
}
//-------------------------------
void OnDeinit(const int reason){}
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick(){
//----------------------------- check everything -----
if(Bars<100 || !TerminalInfoInteger(TERMINAL_TRADE_ALLOWED) || OrdersTotal()>0 ||
                  !CheckMoneyForTrade(_Symbol,Lots,OP_BUY)  ||
                  !CheckMoneyForTrade(_Symbol,Lots,OP_SELL) ||
                  !CheckVolumeValue(Lots,myDes)){Print(myDes); return;
}
//------------------------------------ BUY -----------------------
if(OrderSend(_Symbol,OP_BUY,Lots,Ask,3,SL==0?0:Ask-SL*_Point*Cb,//Set SL Value
                                       TP==0?0:Ask+TP*_Point*Cb,//Set TP Value
                                       "",Mgc,0,Lime)!=-1)      //Return Value
                                       Print("New Position Opened");
                                       else Print("Error ",GetLastError());
//------------------------------------ SELL ----------------------
if(OrderSend(_Symbol,OP_SELL,Lots,Bid,3,SL==0?0:Bid+SL*_Point*Cb,//Set SL Value
                                        TP==0?0:Bid-TP*_Point*Cb,//Set TP Value
                                        "",Mgc,0,Red)!=-1)       //Return Value
                                        Print("New Position Opened");
                                        else Print("Error ",GetLastError());
}
//+------------------------------------------------------------------+
//| Check the correctness of the order volume                        |
//+------------------------------------------------------------------+
bool 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);
 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);
 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);
 return(false); }
 description="Correct volume value";
 return(true); }
//+------------------------------------------------------------------+
//| Check sufficient funds to perform trade operation                |
//+------------------------------------------------------------------+
bool CheckMoneyForTrade(string symb, double lots,int type){
 double free_margin=AccountFreeMarginCheck(symb,type, lots);
 //-- if there is not enough money
 if(free_margin<0) {
 string oper=(type==OP_BUY)? "Buy":"Sell";
 Print("Not enough money for ", oper," ",lots, " ", symb, " Error code=",GetLastError());
 return(false); }
 //--- checking successful
 return(true); }
//------------------------------------- Test26.com 19/06/2026 -----------------------------




 

You've set a fixed lot size of 0.01, but if the trading account doesn't accept this micro-lot, the EA simply won't open a position. This needs improvement. I did a very basic implementation in your code just to confirm this theory, and the EA passed the automatic validation:

//+------------------------------------------------------------------+
//|                                                    MinimalEA.mq4 |
//|                                       Copyright 2026, Test26.com |
//|                                           https://www.Test26.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2026, Test26.com"
#property link      "https://www.Test26.com"
#property version   "2.03"
#property strict
#define   EAName       "EA_Test_V2"
#property description   EAName
//---------------------------------------------------------
input int      Mgc   = 12345;//Magic Number
input double   Lots  = 0.01;
input double   TP    = 400;
input double   SL    = 200;

int Cb = _Digits==3?10:1;//Calibration for 3 Digits Price
string   myDes = "";//Volume Value Description
double g_lot = Lots;
//+------------------------------------------------------------------+
//| Expert initialization & deinitialization function                |
//+------------------------------------------------------------------+
int  OnInit()
  {
   if(!TerminalInfoInteger(TERMINAL_TRADE_ALLOWED))
      return(INIT_FAILED);
   return(INIT_SUCCEEDED);
  }
//-------------------------------
void OnDeinit(const int reason) {}
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//----------------------------- check everything -----
   if(Bars<100 || !TerminalInfoInteger(TERMINAL_TRADE_ALLOWED) || OrdersTotal()>0 ||
      !CheckMoneyForTrade(_Symbol,g_lot,OP_BUY)  ||
      !CheckMoneyForTrade(_Symbol,g_lot,OP_SELL) ||
      !CheckVolumeValue(g_lot,myDes))
     {
      Print(myDes);
      return;
     }
//------------------------------------ BUY -----------------------
   if(OrderSend(_Symbol,OP_BUY,g_lot,Ask,3,SL==0?0:Ask-SL*_Point*Cb,//Set SL Value
                TP==0?0:Ask+TP*_Point*Cb,//Set TP Value
                "",Mgc,0,Lime)!=-1)      //Return Value
      Print("New Position Opened");
   else
      Print("Error ",GetLastError());
//------------------------------------ SELL ----------------------
   if(OrderSend(_Symbol,OP_SELL,g_lot,Bid,3,SL==0?0:Bid+SL*_Point*Cb,//Set SL Value
                TP==0?0:Bid-TP*_Point*Cb,//Set TP Value
                "",Mgc,0,Red)!=-1)       //Return Value
      Print("New Position Opened");
   else
      Print("Error ",GetLastError());
  }
//+------------------------------------------------------------------+
//| Check the correctness of the order volume                        |
//+------------------------------------------------------------------+
bool 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(true);
     }
//--- 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(true);
     }
//--- 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);
      return(false);
     }
   description="Correct volume value";
   return(true);
  }
//+------------------------------------------------------------------+
//| Check sufficient funds to perform trade operation                |
//+------------------------------------------------------------------+
bool CheckMoneyForTrade(string symb, double lots,int type)
  {
   double free_margin=AccountFreeMarginCheck(symb,type, lots);
//-- if there is not enough money
   if(free_margin<0)
     {
      string oper=(type==OP_BUY)? "Buy":"Sell";
      Print("Not enough money for ", oper," ",lots, " ", symb, " Error code=",GetLastError());
      return(false);
     }
//--- checking successful
   return(true);
  }
//------------------------------------- Test26.com 19/06/2026 -----------------------------
//+------------------------------------------------------------------+


But please, this was just a test example, don't take it seriously. 😁 See the following code for how to properly validate the volume (and other important validations):

Code Base

V1N1 LONNY MT4

Vinicius Pereira De Oliveira, 2017.01.25 09:12

Asian Range Breakout day-trading EA. Multi-symbol, M15/M30/H1. Places pending stop orders during the London session outside the pre-London Asian range, using PSAR + MACD + Stochastic signals, with automatic London/NY DST handling, structural stops, trailing and break-even.