orderclose be error

 
void PlaceOrder(int iSignal){

   int iTicket;
   
   if(iSignal == 1)
   {
      iTicket=OrderSend(Symbol(),OP_BUY,dLots,Ask,3,Bid-iStopLoss*Point,Ask+iTakeProfit*Point,"My First EA",iMagicNumber,0,Green);
      if(iTicket>0){
         if(OrderSelect(iTicket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
      }else{
         Print("Error opening BUY order : ",GetLastError());
      }
   }
   
   if(iSignal == 2)
   {
      iTicket=OrderSend(Symbol(),OP_SELL,dLots,Bid,3,Ask+iStopLoss*Point,Bid-iTakeProfit*Point,"My First EA",iMagicNumber,0,Red);
      if(iTicket>0){
         if(OrderSelect(iTicket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
      }else{
         Print("Error opening SELL order : ",GetLastError());
      }
   }
   if(iSignal == 3)
   {
     iTicket=OrderClose(iTicket,dLots,Bid,3,Green);
   }
   if(iSignal == 4)
   {
     iTicket=OrderClose(iTicket,dLots,Ask,3,Red);
   }
   
   return(0);
   
}

void TrailingStop(int iTotal){

   int iCount;
   
   if(iTrailingStop < 1)return(-1); // error
   
   for(iCount=0;iCount<iTotal;iCount++){

      OrderSelect(iCount, SELECT_BY_POS, MODE_TRADES);
      if(OrderSymbol()==Symbol() && OrderMagicNumber() == iMagicNumber)
         switch(OrderType()){
            case OP_BUY:
               if(Bid-OrderOpenPrice()>Point*iTrailingStop){
                  if(OrderStopLoss()<Bid-Point*iTrailingStop){
                     OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*iTrailingStop,OrderTakeProfit(),0,Green);
                  }
               }
               break;
            case OP_SELL:
               if((OrderOpenPrice()-Ask)>(Point*iTrailingStop)){
                  if((OrderStopLoss()>(Ask+Point*iTrailingStop)) || (OrderStopLoss()==0)){
                     OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*iTrailingStop,OrderTakeProfit(),0,Red);
                  }
               }
               break;
         }
      }
   
      return(0);
}

int CheckForCross(){
   static int siLastDirection = 0;
   static int siCurrentDirection = 0;
double ma5, ma21, ma50, ma80;
// get the current prices for each moving average
   ma5 = iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,0);
   ma13 = iMA(NULL,0,13,0,MODE_EMA,PRICE_CLOSE,0);
   ma21 = iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE,0);
   ma80 = iMA(NULL,0,80,0,MODE_EMA,PRICE_CLOSE,0);
 // check if lines have crossed
  if( ma5 > ma13 && ma5 > ma21 && ma5 > ma80 && v1>50 ) siCurrentDirection = 1; //up
   if(  ma5 < ma13 && ma5 < ma21 && ma5 < ma80 && v1<50 ) siCurrentDirection = 2; //down
   if ( ma5 < ma21 ) siCurrentDirection = 3;
   if ( ma5 > ma21 ) siCurrentDirection = 4;

   if(siCurrentDirection != siLastDirection){
      // they have so return the new signal
      siLastDirection = siCurrentDirection;
      return (siLastDirection);
   }
   
   // no cross
   return(0);
} 
Yellow it error.i don't understrand
 
phipho:
Yellow it error.i don't understrand

What are Function return values ? How do I use them ?

OrderClose() does not return an int 

 

when ma5 > ma21  return values