Download MetaTrader 5

Move break even

To add comments, please log in or register
Does your signal already have a lot of of subscribers? It's time to think about the paid subscription!
Marinus Prayitno
382
Marinus Prayitno 2015.10.15 08:17 
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