What the message do You get in the logs (expert log and client terminal log)?
Insert GetLastError function call after trade function and see what the error code You get.
Insert GetLastError function call after trade function and see what the error code You get.
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
{ OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES); if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) { 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