Trailing Stop on 2nd order

 

Hi, I have this statement to place 2 orders


if(Long)
{
ticket_1=OrderSend(Symbol(),OP_BUY,Lots,Ask,NULL,15,15,"UP",0,0,Green);
ticket_2=OrderSend(Symbol(),OP_BUY,Lots,Ask,NULL,15,30,"UP",0,0,Green);

}


I need to move my trailing stop on the second order(ticket_2) only when the first order reach its 15 pips target, and the second order remains alone on the market.


How can I proceed?

Thank you!

 
No need to proceed yet, as your orders above will not be executed, probably with an error like "invalid stops".
 
Sorry I don't understand, what's the problem with the stop loss level?
 
StopLoss and TakeProfit must be a price, not a number of pips, in the command.
 

if(Long)
{
ticket_1=OrderSend(Symbol(),OP_BUY,Lots,Ask,NULL,Bid-StopLoss*Point,Ask+TakeProfit*Point,"UP",0,0,Green);
ticket_2=OrderSend(Symbol(),OP_BUY,Lots,Ask,NULL,Bid-StopLoss*Point,Ask+TakeProfit*Point,"UP",0,0,Green);
}

Ops, sorry. Now it works.

Reason: