A puzzle on the sound of closing a pending order ?

 

In my earlier topic, I did not explained myself clearly. So, I try to send the problem precisely:

if the order I sent is
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,bid-StopLoss*Point,Ask+TakeProfit*Point,"macd sample",16384,0,Green);
and it is accepted by the main server. And I do not use OrderClose or OrderModify to change such
order any more. Just waiting for the result from the Main server of the trader. when
the Price reach to the Ask+TakeProfit*Point, the main server will close the order due to take
profit. I want a glad sound when the order is closed by the main server of the trader.
And a sorrow sound for Stoploss.

Can any one with kindness help me?

 

double tprfsound, stplssound;

....

start(){

....

if(OrderSend....)

{

tprfsound=Ask+TakeProfit*Point;

stplssound=bid-StopLoss*Point;

}

if(OrderTotal()>0)

{

if (Ask>=tprfsound&&tprfsound>Point) {PlaySound(...wav);tprfsound=0;}

if(Bid<=stplssound&&stplssound>Point){PlaySound(...wav);stplssound=0;}

}

....

}

Reason: