Thread: How to code?
View Single Post
  #32 (permalink)  
Old 03-03-2006, 09:00 PM
stu stu is offline
Junior Member
 
Join Date: Feb 2006
Posts: 20
stu is on a distinguished road
Question Have code, need help making EA

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.
Reply With Quote