I have a portion of code for a Moving Stop, but have no programming experience to make an EA out of it. Will somebody with EA creation ability kindly produce an EA with the code below?!?
Code:
total=OrdersTotal();
if(total>0){
for(cnt=0;cnt<total;cnt++){
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()==OP_BUY && OrderSymbol()==Symbol()){
if(Bid-OrderOpenPrice()>=Point*15 && Bid-OrderOpenPrice()<Point*20 && OrderStopLoss()< OrderOpenPrice()-5*Point){
OrderModify(OrderTicket(),OrderOpenPrice()-Point*5,OrderTakeProfit(),Blue);
}
if(Bid-OrderOpenPrice()>=Point*20 && OrderStopLoss()< OrderOpenPrice()){
OrderModify(OrderTicket(),OrderOpenPrice(),OrderTakeProfit(),Blue);
}
}
}
}
The EA will move the Stop to -5 after moving 15 pips favorably, and move Stop to BreakEven after moving 20 pips favorably.
