Am working now with a sound file. The sound file is 4 seconds in length. It kicks in when the conditions are met. However, as I am using it on a 5Min DataSeries whenever it kicks in, it stays in and the sound file is played over and over for 5 minutes or longer as the conditions still exist. What I would like is for it to play perhaps 3 or 4 times but then stop.
And only kick in again when the conditions are being met again perhaps 20 minutes or half an hour later. In which way code-wise could I achieve it doing that?
// Condition set 1
if (Close[0] > Opens[0][0]
&& Close[0] > EMA(BarsArray[0],13)[0]
etc.etc. )
{
BarColor = upColor; PlaySound(@"C:\Sounds\mysound.wav");
}
else if (Close[0] > Opens[0][0])
{
BarColor = Color.Empty;
}
sandman
Comment