Trailing code

 

Hello,


I tried to use the following line, to create a stop at a certain gain level and (at the same time) a takeprofit modification, but I probably made a mistake, since

the modification is not executed (the alert-sound is played sometimes):


extern int TicketBuy,TicketSell;

extern double       TrailingStopUp1;

extern double       TrailingStopLevelUp1;

extern double TakeprofitUp1;


if(

   (OrderSelect(TicketBuy, SELECT_BY_TICKET)==true) {    OrderSelect(TicketBuy, SELECT_BY_TICKET);   if(Bid>= TrailingStopUp1)  {OrderModify(TicketBuy,Bid,TrailingStopLevelUp1,TakeprofitUp1,"Buy1Comment",Blue); PlaySound("1wav.wav");}


maybe the  distance of the TP levels etc.(while testing..) were to close to the present Bid, I was wondering.

If anybody has hints, thanks in advance


Mike




Reason: