I developed an indicator and I wish it could play a sound and show a pop up message on certain condition.
The sound works but the message shows up in infinite loop.
Here's my code:
if (CurrentBar != savedBar) // if current bar is NOT equal to the savedBar
{
PlaySound(NinjaTrader.Core.Globals.InstallDir + @"\sounds\Alert4.wav");
MessageBox.Show("This is an OnBarUpdate() test", "Testing OnBarUpdate()!");
savedBar = CurrentBar; // save the current bar here to make them equal
}
Thanks,

Comment