I want the alert to trigger when a tick of a new bar exceeds the highest high of the previous 2 bars. But, the alert is trigering on every bar including new bars that are equal or lower than the previous bars. Any suggestions, please? Thanks.
protectedoverridevoid OnBarUpdate()
{
if (CurrentBar < 5)
return;
if(FirstTickOfBar)
{
if (High[0] > MAX(High,2)[1] + 3 * TickSize);
{
Alert("Alert1", Cbi.Priority.Medium, "New High hit!", Cbi.Core.InstallDir + @"\sounds\Alert4.wav", 5, Color.Yellow, Color.Black);
}
}
}

Comment