Order Modify Error 1

 

hi, how can i fix this?


int _GetLastError=0, _OrdersTotal=OrdersTotal();
   
   for (int z=_OrdersTotal-1; z>=0; z--)
    {
    
         if ( !OrderSelect( z, SELECT_BY_POS ) )
        {
            _GetLastError=GetLastError();
            Alert("OrderSelect ",z," SELECT_BY_POS - Error: ", _GetLastError);
            continue;
        }
        
        if ( OrderSymbol() != Symbol() ) 
        continue;
        
        if ( OrderMagicNumber() != _MagicNumber ) 
        continue;
        
        int BarCount=iBarShift(NULL,0,OrderOpenTime());
        
        if ( OrderType() == OP_BUY )
        {
        
            if (BarCount>TimeStop)
            {
                  
                if(!OrderModify( OrderTicket(), OrderOpenPrice(), OrderStopLoss(), NormalizeDouble(OrderOpenPrice()+OPBUY*Point,Digits), 0, Blue ) )
                {
                    _GetLastError=GetLastError();
                    Alert("OrderModifyError: ", _GetLastError);                    
                    return(0);
                }
            }
            else
            return(0);
        }
        
        if ( OrderType() == OP_SELL )
        {
            
            if (BarCount>TimeStop)
            {
                
                if(!OrderModify( OrderTicket(), OrderOpenPrice(), OrderStopLoss(), NormalizeDouble(OrderOpenPrice()+OPSELL*Point,Digits), 0, Red ) )
                {
                    _GetLastError=GetLastError(); 
                    Alert("OrderModifyError: ", _GetLastError);
                    return(0);
                }
            }
            else 
            return(0);
        }
    }
 
occupy: how can i fix this?
ERR_NO_RESULT
You Server
Change the SL to XIt is at X!
Change the SL to X It is at X!
Change the SL to XYou are insane
Don't try to move the SL less than a point.
 
occupy:

hi, how can i fix this?

Obviously you try to change (by OrderModify) TP with the same value that TP already has. See this

Reason: