OrderModify Errors 1, 130
HI, went through your post. It works sometimes - in fact, when I first added the code to move stops to zero, it worked fine, and even when I moved them to 3 pips more than my entry. But once I changed some of the other criteria(aside from entry/modify) it would stop working.
This same modifying script works fine in my other experts.
thanks
Mr RaptorUK,
You are the expert here. Could you help me with the codes? Really not sure what went wrong about the Ordermodify Error 1.
void DoModify1() { int atr=ATR(1); for(int i=0;i<OrdersTotal(); i++) { RefreshRates(); bool b=OrderSelect(i,SELECT_BY_POS,MODE_TRADES); if (!b) continue; if (OrderSymbol()!=Symbol()) continue; if (OrderMagicNumber()!=Magic) continue; if (OrderType()==OP_BUY) { if(OrderStopLoss()==0) { double sl= OrderOpenPrice()-atr*myPoint*AtrPecSL; OrderModify(OrderTicket(),OrderOpenPrice(),sl,OrderTakeProfit(),0,Red); } else if(OrderTakeProfit()==0 && ! IsClosePer) { double tp= OrderOpenPrice()+atr*myPoint*AtrPecTP; OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),tp,0,Green); } else if(IsClosePer && OrderTakeProfit()!=0) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),0,0,White); } } else if (OrderType()==OP_SELL) { if(OrderStopLoss()==0) { sl= OrderOpenPrice()+atr*myPoint*AtrPecSL; OrderModify(OrderTicket(),OrderOpenPrice(),sl,OrderTakeProfit(),0,Red); } else if(OrderTakeProfit()==0 && ! IsClosePer) { tp= OrderOpenPrice()-atr*myPoint*AtrPecTP; OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),tp,0,Green); } else if(IsClosePer && OrderTakeProfit()!=0) { OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),0,0,White); } } } }
Mr RaptorUK,
You are the expert here. Could you help me with the codes? Really not sure what went wrong about the Ordermodify Error 1.
Hi,
I keep getting ordermodify errors 1 and 130 when executing this code:
Please note that the "Lot" variable is predefined, and the call to the LOT() function is not being used right now.