First EA not yet working....help please

 

Dear All,

I'm attracted by the world of automated trading and have started to study Mql5 since 5 months.

I have read a lot of documents, articles and am trying to write my first simple EA as training. I fixed all errors and warning but it does not issue Orders. 

I'm checking it since a week but unsuccesfully.

Could someone be so kind to give me an input about the problem? 

Thanks a lot!


It is the core of my code:

bool SetupBUY = false;
bool FullConditionBUY = false
double PriceBreak 
datetime TimeBarMinRel;          
datetime TimeBarCurrent;  
int NumBars;                     
   
   ZeroMemory(TimeBarMinRel);
   ZeroMemory(PriceBreak);


   if(mrate[4].low>maVal[4] &&   
   mrate[3].low>maVal[3] &&   
   mrate[2].low>maVal[2] &&
   mrate[1].low>maVal[1])
     {
      if(mrate[4].low<mrate[3].low &&   
          mrate[3].low<mrate[2].low &&
          mrate[2].low>mrate[1].low)
          {
           SetupBUY = true;   
           PriceBreak=mrate[1].high;
          TimeBarMinRel = iTime(_Symbol,_Period,1);  
         }
      }
        
   if(SetupBUY = true)   
      {
       TimeBarCurrent = iTime(_Symbol,_Period,0);
      NumBars=Bars(_Symbol,_Period,TimeBarMinRel,TimeBarCurrent);   
      if(NumBars<=MaxBars &&
         SymbolInfoTick(_Symbol,latest_price)>PriceBreak)
          {
           FullConditionBUY = true; 
           SetupBUY = false;   
          }
      
       if(NumBars>MaxBars)   
          { 
           SetupBUY = false;   
          }
      }
      
  
   if(FullConditionBUY = true
     {
      if(Buy_opened) 
        {
         Alert("C'è già una posizione BUY aperta!!!"); 
         return;    
        }
         
         mrequest.action = TRADE_ACTION_DEAL;                                           
         mrequest.price = NormalizeDouble(latest_price.ask,_Digits);
         mrequest.sl = NormalizeDouble(latest_price.ask - SL*_Point,_Digits);           
         mrequest.tp = NormalizeDouble(latest_price.ask + TakeProfit*_Point,_Digits);
         mrequest.symbol = _Symbol;                                                     
         mrequest.volume = Lot;
         mrequest.magic = EA_Magic;
         mrequest.type = ORDER_TYPE_BUY;
         mrequest.type_filling = ORDER_FILLING_FOK;
         mrequest.deviation=100; 
         
         if(!OrderSend(mrequest,mresult))
            PrintFormat("OrderSend error %d",GetLastError());       
            PrintFormat("retcode=%u  deal=%I64u  order=%I64u",mresult.retcode,mresult.deal,mresult.order);
            FullConditionBUY = false;
     }
}