Download MetaTrader 5

Open new order after hit TP

To add comments, please log in or register
otai97
31
otai97  
extern double Lots = 0.01;
extern int Slippage   = 3;
extern double TP = 0.00200;
extern int MagicNumber=11111;
string text = "Forex Mudah";

int init()
{
   return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
{
   return(0);
}

int start()
  {

   int ticket = 0;
      for (int i=OrdersTotal(); i < 1; i++)                        //Ñþäà ìû âòûêàå èíäèêàòîðà
         {
         //if((OrderType() == OP_SELL||OrderType() == OP_BUY) && OrderSymbol () ==Symbol())  
         //ticket++;
         
         ticket = OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,Ask - 0.00200,text,MagicNumber,0,Green);
         ticket = OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Bid + 0.00200,text,MagicNumber,0,Green);
         
       }
  
   //if(ticket>0){
      //if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)){};
  //}

return(0);
}


Anyone can help me with this coding? i want to make if buy or sell have been closed or TP , i want the closed last order to reopen the order.

Jose Francisco Casado Fernandez
4642
Jose Francisco Casado Fernandez  
You can consider this section:  https://www.mql5.com/es/job  or search in Code Base.  Regards.
trabajo MQL5
trabajo MQL5
  • www.mql5.com
Encargos de desarrollo de programas para el trading
To add comments, please log in or register