I'd like an audio warning when the the bid price rises above a down trending ema. My code works fine but I only want the audio file to play once and then wait for price to go below the ema to reset.
How do I change the play sound file to do what I want?
// Condition set 1 looks for a short down trend in the EMA three bars back
condition1 = (EMA(14)[3] > EMA(14)[2] && EMA(14)[2] > EMA(14)[1] && EMA(14)[1] > EMA(14)[0]? true : false);
//condition set 2 looks for the bid price to break above the ema for a short signal pull back warning
condition2= (GetCurrentBid() > EMA(14)[0]? true : false);
/* Condition set 3 takes all conditions and if they all equal true statements it plays a warning sound*/
if (condition1 && condition2)
{
PlaySound(audiofile);
}

Comment