OrderModify isn't working

 

Help! Can't get my EA to modify the order.  What am I doing wrong?

if(OrderSelect(ticket, SELECT_BY_TICKET)==true)
          {
           open_price = OrderOpenPrice();
           stoploss_level = open_price + (stoploss * Point);
           takeprofit_level = open_price - (takeprofit * Point);  
          }   
       
      if(ticket > 0)
       { 
         if (OrderSelect(ticket, SELECT_BY_TICKET)== true)         
           {
             OrderModify(ticket,0,stoploss_level,takeprofit_level,0); 
           } 
        }   
 
forestmyopia:

Help! Can't get my EA to modify the order.  What am I doing wrong?


Why don't you check if the OrderModify() works and it it doesn't report the error,  that might give you some idea of what is wrong:  What are Function return values ? How do I use them ?

 

Why do you expect that you can change the open price of an existing order ?  how would that work ?