Too close stops. Your TrailingStop value is less than freeze level. To know freeze level use MarketInfo function
I have the same problem here. i used many settings but it still giving me errors.
so i used
bool modifySL; modifySL=OrderModify(OrderTicket(),OrderOpenPrice(),nStopLoss,OrderTakeProfit(),OrderExpiration(),CLR_NONE); if(!modifySL) { Print("StopLoss Price is not modify"); } else { modifySL=true; }
and now i receiving Occasionally & very low errors.
But Forex Trader is right we need to use Trailing or SL on Freeze level. I think our trailing and SL prices is too close when we receive these errors.
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
if(OrderType()==OP_BUY) // long position is opened { // check for trailing stop if(TrailingStop>0) { if(Bid-OrderOpenPrice()>Point*TrailingStop) { if(OrderStopLoss()<Bid-Point*TrailingStop) { OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green); return(0); } } } } else // go to short position { // check for trailing stop if(TrailingStop>0) { if((OrderOpenPrice()-Ask)>(Point*TrailingStop)) { if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red); return(0); } } } } } } return(0); }Any help to resolve this error is greatly appreciated.