EA opens Limit order and closes it in seconds and repeats - page 2

 
Darius: I made this code: and i get error every second i.e. "EURUSD,M5: OrderSend failed, error # 0"

This is your code:

   if(buy_orders <= 0 /* &&  -OTHER CONDITIONS- */ )
     {
      ticket=OrderSend(Symbol(),OP_BUY,InitLots,Ask,10,SL,TP,0,MAGIC,0,Lime);
     }

   if( ticket > 0 )   {   Print("Order placed # ", ticket);}
   else   {   Print("Order Send failed, error # ", GetLastError() );   }
You are testing ticket even if you haven't opened one.