I have been using the Market Analyser window to run audio alerts on the NYSE-TICK with a feed from IB. What I noticed is that sometimes the alerts don't trigger even though there is a TICK reading which just penetrates the programmed levels.
I programmed the following into an indicator with the help of the wizard:
// Condition set 1
if (Close[0] >= TL1 && Close[0]<TL2)
{
PlaySound(@"D:\Program Files\NinjaTrader 6\sounds\Elvis.wav");
}
// Condition set 2
if (Close[0] >= TL2 && Close[0]<TL3)
{
PlaySound(@"D:\Program Files\NinjaTrader 6\sounds\all_shook_up.wav");
}
// Condition set 3
if (Close[0] >= TL3)
{
PlaySound(@"D:\Program Files\NinjaTrader 6\sounds\Eagle.wav");
}
// Condition set 4
if (Close[0] <= -TL1 && Close[0]>-TL2)
{
PlaySound(@"D:\Program Files\NinjaTrader 6\sounds\Elvis.wav");
}
// Condition set 5
if (Close[0] <= -TL2 && Close[0]>-TL3)
{
PlaySound(@"D:\Program Files\NinjaTrader 6\sounds\all_shook_up.wav");
}
// Condition set 6
if (Close[0] <= -TL3)
{
PlaySound(@"D:\Program Files\NinjaTrader 6\sounds\Eagle.wav");
}
Basically the code sets 3 alert levels defined by the variables TL1, TL2 and TL3. It works fine when run on a tick chart of the TICK. The only problem is of course that when a TICK reading occurs greater than the specified level, it is usually followed by 2 or three more and the alert repeats.
Is there anyone that knows how to adjust the code to make it that the alert doesn't repeat for say 1 minute after being trigger?
Any suggestions are greatly appreciated.

Comment