Mq5 source code problem

 
Hello,I have a problem with my code
The Ea should place an order limit once it finds an entry even if there is an open order limit,However it doesn't(the ea is always wait the last order limit be closed). What the problem with my code?
This is my code
Dossiers :
test.mq5  13 kb
 

Votre code contient cette partie :

// sell 10 Microlot
   Open4= iOpen(Symbol(),Period(),4);
   Open5= iOpen(Symbol(),Period(),5);
   if(signal =="sell1" && OrdersTotal()==0 && PositionsTotal()==0)
     {
      trade.SellLimit(3.00,Open5,NULL,SL,TP,ORDER_TIME_GTC,0,0);
     }
   if(signal =="sell2" && OrdersTotal()==0 && PositionsTotal()==0)
     {
      trade.SellLimit(3.00,Open4,NULL,SL,TP,ORDER_TIME_GTC,0,0);
     }
// buy 10 Microlot
   if(signal =="buy1" && OrdersTotal()==0 && PositionsTotal()==0)
     {
      trade.BuyLimit(3.00,Open5,NULL,SL,TP,ORDER_TIME_GTC,0,0);
     }
   if(signal =="buy2" && OrdersTotal()==0 && PositionsTotal()==0)
     {
      trade.BuyLimit(3.00,Open4,NULL,SL,TP,ORDER_TIME_GTC,0,0);
     }
// Create a chart output
   Comment("The current signal is: ",signal);
  }
//+------------------------------------------------------------------+

Vous vérifiez s'il y a des commandes sur le compte. Vous devez supprimer cela si vous ne voulez pas un tel contrôle.

Raison: