Validation completed with errors

 

I am trying to Validate my Expert Advisor to put on the Market. I get this error when attempting to Validate.


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

What is wrong with my code?

#property strict
#property copyright   "2020, Ian MacMillan"
#property version   "4.00"                                                    // Version
#property description "This Expert Advisor is based on Moving Average indicator and MACD." // Description (line 1)
#property description "The input parameters are optimized for EURUSD M15."         // Description (line 2)
extern string    Name_Expert = "tuvix2"; 
extern int       StopLoss = 44;
extern int       TakeProfit = 24; 


extern string    moneymanagement="Money Management";
extern double    PercentToRisk = 25;
 double    Lots = 0.01;

//**************************************************************************************************




int init()

  {
  if(Digits == 5 || Digits ==3)
  {
  StopLoss=StopLoss*10;
  TakeProfit=TakeProfit*10;

 
 
  }
   return(0);
  }
int deinit()
  {
   return(0);
  }
  
  
  

int start()


 


// Maximum Spread
{
double SymSpread = MarketInfo(Symbol(), MODE_SPREAD); // This will Obtain broker Spread for current pair

if(30 > 0 && 30 < SymSpread) // This part compares broker spread with maximum allowed spread, and refuse trade if maxspread is exceeded

{

Print("Spread is greater than Maximum allowed Spread");

return(0);} 

// Risk Percent
   double Risk = PercentToRisk / 100;
        if (true)
        Lots = NormalizeDouble(AccountBalance()*Risk/StopLoss/(MarketInfo(Symbol(), MODE_TICKVALUE)),2);       
//******************************************************************************************************* 
   if(Bars<100){
      Print("bars less than 100");
      return(0);
   }
   if(TakeProfit<10){
      Print("TakeProfit less than 10");
      return(0);
   }
    
     double MA=iMA(NULL,0,69,0,MODE_EMA,PRICE_CLOSE,0);
   
     

   

   double Macd_1, Macd_2, Macd_3;
   int shift=12;
   
 

   Macd_1 = iMACD(NULL,0,37,9,1,PRICE_CLOSE,MODE_MAIN,shift);
   Macd_2 = iMACD(NULL,0,37,9,1,PRICE_CLOSE,MODE_MAIN,shift+1);
   Macd_3 = iMACD(NULL,0,37,9,1,PRICE_CLOSE,MODE_MAIN,shift+2);
      
     
   if (!ExistPositions()){

  if(((Hour()>1)&&(Hour()<23))
 || (Hour()==1&&Minute()>=5)
 || (Hour()==23&&Minute()<59))
 
 
 
       if (Macd_1>0 && Macd_2<0 && Macd_3<0) 
       if (Bid > MA)
   

      
          {
        
          OpenBuy();
         return(0);
      }

  if(((Hour()>1)&&(Hour()<23))
 || (Hour()==1&&Minute()>=5)
 || (Hour()==23&&Minute()<59))
   
      if (Macd_1<0 && Macd_2>0 && Macd_3>0)
      if (Bid < MA)
 
    
          {
         OpenSell();
         return(0);
      }
   }
   return(0);
}

bool ExistPositions() {
for (int i=0; i<OrdersTotal(); i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol()==Symbol()) {
return(True);
}
} 
} 
return(false);
}
void TrailingPositionsBuy(int trailingStop) { 
   for (int i=0; i<OrdersTotal(); i++) { 
      if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { 
         if (OrderSymbol()==Symbol()) { 
            if (OrderType()==OP_BUY) { 
               if (Bid-OrderOpenPrice()>trailingStop*Point) { 
                  if (OrderStopLoss()<Bid-trailingStop*Point) 
                     ModifyStopLoss(Bid-trailingStop*Point); 
               } 
            } 
         } 
      } 
   } 
} 
void TrailingPositionsSell(int trailingStop) { 
   for (int i=0; i<OrdersTotal(); i++) { 
      if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { 
         if (OrderSymbol()==Symbol()) { 
            if (OrderType()==OP_SELL) { 
               if (OrderOpenPrice()-Ask>trailingStop*Point) { 
                  if (OrderStopLoss()>Ask+trailingStop*Point || 
OrderStopLoss()==0)  
                     ModifyStopLoss(Ask+trailingStop*Point); 
               } 
            } 
         } 
      } 
   } 
} 
void ModifyStopLoss(double ldStopLoss) { 
   bool fm;
   fm = OrderModify(OrderTicket(),OrderOpenPrice
(),ldStopLoss,OrderTakeProfit(),0,CLR_NONE); 

} 

void OpenBuy() { 
   double ldLot, ldStop, ldTake; 
   string lsComm; 
   ldLot = GetSizeLot(); 
   ldStop = 0; 
   ldTake = GetTakeProfitBuy(); 
   lsComm = GetCommentForOrder(); 
   OrderSend(Symbol
(),OP_BUY, Lots,Ask,2,Bid-StopLoss*Point,Ask+TakeProfit*Point,ldTake,lsComm,0,0); 
  
} 
void OpenSell() { 
   double ldLot, ldStop, ldTake; 
   string lsComm; 
   ldLot = GetSizeLot(); 
   ldStop = 0; 
   ldTake = GetTakeProfitSell(); 
   lsComm = GetCommentForOrder(); 
   OrderSend(Symbol
(),OP_SELL, Lots,Bid,2,Ask+StopLoss*Point,Bid-TakeProfit*Point,ldTake,lsComm,0,0); 

} 
string GetCommentForOrder() { return(Name_Expert); } 
double GetSizeLot() { return(Lots); } 
double GetTakeProfitBuy() { return(Ask+TakeProfit*Point); } 
double GetTakeProfitSell() { return(Bid-TakeProfit*Point); } 
Reason: