|
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.
|