how to buy or sell ON the sigbal only

 
i need to buy or sell when i get the signal from the indidcator and close the trade when i get the reversal signal to buy oy sell, can anybody point me in the right direction, please than k you
 
bool SendOrder = false;
bool CloseOrder = false;

if (your condition to send order)
   {
   SendOrder = true;
   }
   
if (SendOrder)
   {
   SendOrder = false;
   OrderSend(Symbol(),OP_BUY,1,Ask,3,0,0,NULL,16384,0,Green);
   }
   
if (your condition to close order)
   {
   CloseOrder = true;
   }

if (CloseOrder)
   {
   CloseOrder = false;
   OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,Red);
   }
 
qjol:


thank you for your reply, i have an idea now!!!! thanks!!!!!