I created an alert in OBU but the Alert keep on buzzing every 10 seconds. I just want the buzz to be heard once when it meet the condition of the if statement. Right now its buzzing constantly even if foundIndex do not equal index3.
{ double highPrice = Int32.MinValue; for (int barIndex = ChartBars.FromIndex; barIndex <= ChartBars.ToIndex; barIndex++) { if (Bars.GetHigh(barIndex) > highPrice) { highPrice = Bars.GetHigh(barIndex); index3 = barIndex; } } if (foundIndex == index3); [LEFT][COLOR=#808080][FONT=Consolas]Alert([/FONT][/COLOR][/LEFT][LEFT][COLOR=#800000][FONT=Consolas]"myAlert"[/FONT][/COLOR][/LEFT][LEFT][COLOR=#808080][FONT=Consolas],[/FONT][/COLOR][/LEFT][LEFT][COLOR=#FFFFFF][FONT=Consolas] [/FONT][/COLOR][/LEFT][LEFT][COLOR=#808080][FONT=Consolas]Priority.High,[/FONT][/COLOR][/LEFT][LEFT][COLOR=#FFFFFF][FONT=Consolas] [/FONT][/COLOR][/LEFT][LEFT][COLOR=#800000][FONT=Consolas]"Reached threshold"[/FONT][/COLOR][/LEFT][LEFT][COLOR=#808080][FONT=Consolas],[/FONT][/COLOR][/LEFT][LEFT][COLOR=#FFFFFF][FONT=Consolas] [/FONT][/COLOR][/LEFT][LEFT][COLOR=#808080][FONT=Consolas]NinjaTrader.Core.Globals.InstallDir+[/FONT][/COLOR][/LEFT][LEFT][COLOR=#800000][FONT=Consolas]@"\sounds\Alert1.wav"[/FONT][/COLOR][/LEFT][LEFT][COLOR=#808080][FONT=Consolas],[/FONT][/COLOR][/LEFT][LEFT][COLOR=#FFFFFF][FONT=Consolas] [/FONT][/COLOR][/LEFT][LEFT][COLOR=#FF6600][FONT=Consolas]10[/FONT][/COLOR][/LEFT][LEFT][COLOR=#808080][FONT=Consolas],[/FONT][/COLOR][/LEFT][LEFT][COLOR=#FFFFFF][FONT=Consolas] [/FONT][/COLOR][/LEFT][LEFT][COLOR=#808080][FONT=Consolas]Brushes.Black,[/FONT][/COLOR][/LEFT][LEFT][COLOR=#FFFFFF][FONT=Consolas] [/FONT][/COLOR][/LEFT][LEFT][COLOR=#808080][FONT=Consolas]Brushes.Yellow);[/FONT][/COLOR][/LEFT][LEFT][COLOR=#FFFFFF][FONT=Consolas] [/FONT][/COLOR][/LEFT] }
Thanks
Comment