Thread: How to code?
View Single Post
  #27 (permalink)  
Old 02-23-2006, 06:17 PM
Nicholishen's Avatar
Nicholishen Nicholishen is offline
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
Try this:

PHP Code:
   total=OrdersTotal();
   if(
total>0){ 
      for(
cnt=0;cnt<total;cnt++){
         
OrderSelect(cntSELECT_BY_POSMODE_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);
            }
         }
      }
   } 

Last edited by Nicholishen : 02-23-2006 at 06:23 PM.
Reply With Quote