This is my first attempt to write a simple NT8 indicator. The purpose is to play a sound file at market open. In the OnBarUpdate() method I have an if stmt:
if (bOpeningBellAlert && Bars.IsFirstBarOfSession && IsFirstTickOfBar && !String.IsNullOrEmpty(sSoundFile))
{
PlaySound(@"" + sSoundFile);
}
The sound file would not play at the first tick of a daily chart. When I changed the if stmt as such:
if (bOpeningBellAlert && !String.IsNullOrEmpty(sSoundFile))
{
PlaySound(@"" + sSoundFile);
}
Then, the sound file would play on every tick. I'm running NT8 version 8.0.14.2 64-bit. I have attached the indicator in hope that someone can take a look and see what I did wrong.
Also, I'm interested to know since playing a sound file at market open is a single event, would an indicator be over killed because it's continuously being check on every tick update?
Thanks in advance for your help
Comment