Thread: How to code?
View Single Post
  #19 (permalink)  
Old 02-05-2006, 02:40 PM
sunwest's Avatar
sunwest sunwest is offline
Member
 
Join Date: Jan 2006
Location: London
Posts: 93
sunwest is on a distinguished road
You are welcome, also to avoid to modify your orders all the time and do it once you could change:

if (OrderType()==OP_BUY && Bid-OrderOpenPrice()>=ProfitModifySL*Point)
fModifyStopLoss(OrderOpenPrice());

if (OrderType()==OP_SELL && OrderOpenPrice()-Ask>=ProfitModifySL*Point)
fModifyStopLoss(OrderOpenPrice());

to

if (OrderType()==OP_BUY && Bid-OrderOpenPrice()>=ProfitModifySL*Point)
if (OrderStopLoss()<OrderOpenPrice()) fModifyStopLoss(OrderOpenPrice());

if (OrderType()==OP_SELL && OrderOpenPrice()-Ask>=ProfitModifySL*Point)
if (OrderStopLoss()>OrderOpenPrice()) fModifyStopLoss(OrderOpenPrice());

S.
Reply With Quote