Download MetaTrader 5

Move break even

To add comments, please log in or register
Marinus Prayitno
396
Marinus Prayitno  
What's wrong with my ea. please help.

when in place on the chart, there is no effect to move SL despite profit and parameters are met

 

 int      XBE_Pips          =15;

 extern  int      BE_Pips = 1;

 

//----

   if (Digits==3 || Digits==5)  {  dPoint=Point*10; }

 

    if(Symbol())      return(0);

   

   int type;

   int ticket;

   int total = OrdersTotal();

   

      {

         ticket = OrderTicket();

         type = OrderType();

         openPrice = OrderOpenPrice();

         stopPrice = OrderStopLoss();

         if(type == OP_SELL && stopPrice >= openPrice && Ask<=(openPrice-XBE_Pips*dPoint) && OrderSymbol()==Symbol())

            if(OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice()-(BE_Pips*dPoint) ,OrderTakeProfit(),0,Red));else;

         else if(type == OP_BUY && stopPrice <= openPrice && Bid>=(openPrice+XBE_Pips*dPoint) && OrderSymbol()==Symbol() )

            if(OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice()+(BE_Pips*dPoint),OrderTakeProfit(),0,Blue));else;

      }


To add comments, please log in or register