Need help with redundant alerts

When using AlertIf(), I am getting redundant alerts on the last bar (still open) on a real-time database using IQFeed.

Here is the code, where I am just forcing the Buy signal on the last bar for testing:

Plot( C, "Close", colorDefault, styleCandle | styleNoTitle );
Buy = BarIndex() == LastValue( BarIndex() );
AlertIf( Buy, "", "Buy (" + Interval(2) + ")", 1, 15, 10 );

Here's the output:

I am using the correct flags to avoid such repeats, so I need help understanding what is going on here. Is it possible that the alert state is reset when new data comes in? This is a weekly chart that is refreshing frequently with new prices that might be triggering the repeat alerts.


The mechanism depends on timestamp, you should go to Tools->Preferences and set "Time stamp of compressed bars" shows "START time of interval (recommended) - that is DEFAULT setting by the way, and UNCHECK "Override: weekly/monhtly bars use day of last trade". Also lookback in AlertIf should be set to 1.

Perfect, I unchecked the override and now it works just like I expected.

Thanks, Thomasz!

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.