Quantcast
Channel: Forex Forum - World Wide Invest
Viewing all articles
Browse latest Browse all 14445

need help what is wrong in this trailingStop code

$
0
0
please have a look at this code, I can´t find the mistake by the sell operation for buy it works :confused: :confused: :confused:

Code:

//////////////////////////// Modify first Order Take Profit und Stoploss //////////////////

  OrderSelect(OrdersTotal()-1, SELECT_BY_POS);
  if(MyRealOrdersTotal(Magic)==1)
    if(OrderType()==OP_BUY)
      if(Bid-OrderOpenPrice()>Point*Traling_Start)
        if(OrderStopLoss()<Bid-Point*Traling_Stop)
          {OrderModify(OrderTicket(),OrderOpenPrice(),Bid-(Point*Traling_Stop),Bid+(Point*TP),0,Blue);}
 
  OrderSelect(OrdersTotal()-1, SELECT_BY_POS);       
  if(MyRealOrdersTotal(Magic)==1)
    if(OrderType()==OP_SELL)
      if(Ask+OrderOpenPrice()<Point*Traling_Start)
        if(OrderStopLoss()>Ask+(Point*Traling_Stop))
          {OrderModify(OrderTicket(),OrderOpenPrice(),Ask+(Point*Traling_Stop),Ask-(Point*TP),0,Blue);}

Thanks a lot

Suffi

Viewing all articles
Browse latest Browse all 14445

Trending Articles