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:
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.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...
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:
Use similar code: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...
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); } }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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...
could somebody help me...