View Single Post
  #6 (permalink)  
Old 06-14-2007, 03:57 PM
european's Avatar
european european is offline
Senior Member
 
Join Date: Apr 2006
Posts: 284
european is on a distinguished road
Plenty of examples of Trailing Stop code on this site - use 'Search' function

My example of TS:
*************************************
extern int TS = 30; //Trailing Stop

int start()
{
//----
OrderSelect(0, SELECT_BY_POS);

if (OrderType() == OP_BUY) {
if (OrderStopLoss() < Bid-Point*TS) OrderModify(OrderTicket(),0,Bid-Point*TS,OrderTakeProfit(),0,Red); }

if (OrderType() == OP_SELL) {
if (OrderStopLoss() > Bid+Point*TS) OrderModify(OrderTicket(),0,Bid+Point*TS,OrderTake Profit(),0,Red); }
//----
}

Last edited by european; 06-14-2007 at 04:09 PM.
Reply With Quote