Error Code 1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

I understand that the error code 1 means there is no change when compiler execute OrderModify. But I cannot understand why such code like below giving error code 1 too...

if(TrailingStop>0)  
                 {                 
                  if(NormalizeDouble(Bid-OrderOpenPrice(),Digits)>(Point*(TrailingStop+0.5)))
                    {
                     if(OrderStopLoss()<NormalizeDouble(Ask-Point*(TrailingStop+0.5),Digits) )
                       {
                        ticket = OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-Point*TrailingStop,Digits),OrderTakeProfit(),0,Green);
                        return(0);
                       }
                    }
                 }

could somebody help me...

 
Don't bother, noone will give you a satisfactory answer, I've asked it too a couple of times. It is probably part of the smoke-screen...
 
riyo:
if(OrderStopLoss()<NormalizeDouble(Ask-Point*(TrailingStop+0.5),Digits) )
{
   ticket = OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-Point*TrailingStop,Digits),OrderTakeProfit(),0,Green);

could somebody help me...

The OrderStopLoss() is checked against a value different from the value put as the new stop loss, so it is quite possible that the new value is just the same as the old one.
Probably below is what you want?
if( OrderStopLoss() < NormalizeDouble(Bid-Point*(TrailingStop+0.5),Digits) ) {
    ticket = OrderModify( OrderTicket(), OrderOpenPrice(),
                          NormalizeDouble(Bid-Point*TrailingStop+0.5,Digits),
                          OrderTakeProfit(), 0, Green );
}
Just make sure whether it's a OP_BUY or OP_SELL and TrailingStop is larger than the pair stoplevel.
 
riyo:

I understand that the error code 1 means there is no change when compiler execute OrderModify. But I cannot understand why such code like below giving error code 1 too...

if(TrailingStop>0)  
                 {                 
                  if(NormalizeDouble(Bid-OrderOpenPrice(),Digits)>(Point*(TrailingStop+0.5)))
                    {
                     if(OrderStopLoss()<NormalizeDouble(Ask-Point*(TrailingStop+0.5),Digits) )
                       {
                        ticket = OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-Point*TrailingStop,Digits),OrderTakeProfit(),0,Green);
                        return(0);
                       }
                    }
                 }

could somebody help me...

Use similar code:
if(TrailingStop>0)  
                 {                 
 
 
                     if(OrderStopLoss()<NormalizeDouble(Ask-Point*(TrailingStop+1),Digits) )
                       {
                        ticket = OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-Point*TrailingStop,Digits),OrderTakeProfit(),0,Green);
                        return(0);
                       }
 
                 }
Reason: