Pages

(Help) Order modify TP error1, Please help

mercredi 23 novembre 2016
Code:

void GetTakeProfit(){ 
    BuyPriceTarget = BuyAveragePrice + BuyTakeProfit * Point; 
    SellPriceTarget = SellAveragePrice - SellTakeProfit * Point;
   
    if(GetCountBuy() > 0){         
        for(int ord_count = 0; ord_count < OrdersTotal(); ord_count++){
            orderselect = OrderSelect(ord_count, SELECT_BY_POS, MODE_TRADES);
            if(OrderSymbol() == Symbol() && OrderMagicNumber() == BuyMagicNo){
              if(OrderType() == OP_BUY){                                         
                  Mod = OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), BuyPriceTarget, 0, clrYellow);                                                                                   
              }
            }
        }       
    }         
    if(GetCountSell() > 0){     
        for(int ord_count = 0; ord_count < OrdersTotal(); ord_count++){
            orderselect = OrderSelect(ord_count, SELECT_BY_POS, MODE_TRADES);
            if(OrderSymbol() == Symbol() && OrderMagicNumber() == SellMagicNo){             
              if(OrderType() == OP_SELL){             
                  Mod = OrderModify(OrderTicket(), OrderOpenPrice(), OrderStopLoss(), SellPriceTarget, 0, clrYellow);                                                                                 
              }             
            }
        }       
    } 
}



(Help) Order modify TP error1, Please help

Aucun commentaire:

Enregistrer un commentaire