■トレイリングストップのやり方


// トレイリングストップの値幅(pips)
extern double TrailingStop = 30;


int start() {
 if(TrailingStop>0) {
  // チケット番号で注文を選択
  OrderSelect(ticket, SELECT_BY_TICKET);

  if(Bid-OrderOpenPrice()>Point*TrailingStop &&
    OrderStopLoss()<Bid-Point*TrailingStop) {


    // 注文を変更
    OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,
            OrderTakeProfit(),0,Green);
    return(0);
  }
 }
}