help ordermodify

 

This part of the code doesnt work and i wonder why.. The fact is it compile correctly but it doesnt change buylimit orderopenprice() to Bid (or any other price i set).

Can someone please help me?

Thankx


void OnTick()
  {

 int total = OrdersTotal();
    
     for(int cnt = 0 ; cnt < total ; cnt++) {  
       if(OrderSelect(cnt,SELECT_BY_POS)==true) {

         if (OrderSymbol() == Symbol()) {  

             if (OrderType()==OP_BUYLIMIT) {

                  if(OrderOpenPrice()!= Bid){

                     bool olimitbuy=OrderModify( OrderTicket(), Bid, OrderStopLoss(),OrderTakeProfit(), 0, Blue )

                  }

            }

        }

      }

  }

}

 

Hello,

are you sure that it's compiling with you?

you forget a semicolon after the modification call, here it's fixed

void OnTick()
  {

 int total = OrdersTotal();
    
     for(int cnt = 0 ; cnt < total ; cnt++) {  
       if(OrderSelect(cnt,SELECT_BY_POS)==true) {

         if (OrderSymbol() == Symbol()) {  

             if (OrderType()==OP_BUYLIMIT) {
                  if(OrderOpenPrice()!= Bid){

                     bool olimitbuy=OrderModify( OrderTicket(), Bid, OrderStopLoss(),OrderTakeProfit(), 0, Blue ) ;

                  }

            }

        }

      }

  }

}