Facing issue related to AlertIf

Hi,

I am facing an issue when displaying alerts in an alert output window.. I am not able to figure out what mistake I have made. The signals (arrows) are getting plotted correctly on a chart but when I use bar reply the alert are not written in output window.. When running bar reply I saw once displaying alert for short (not consistent) and never for buy. I understand that repetitive signals won't be alerted by default, but not even once for Buy and for Short it is not consistent. I don't know what mistake I am making, Please help.

Below is my code.

BUY0 = Cross(H, UPPER_BAND) AND UPPER_BAND >= Ref(HIGH_SINCE_SETUP, -1);
SHORT0 = Cross(LOWER_BAND, L) AND LOWER_BAND <= Ref(LOW_SINCE_SETUP, -1);

Filter = BUY0 OR SHORT0;

AddColumn( IIf( BUY0, Asc( "L" ), IIf( SHORT0, Asc( "S" ), Asc( "N" ) ) ), "Signal", formatChar,
           colorDefault, IIf( BUY0, colorGreen, IIf( SHORT0, colorRed, colorBlue ) ) );
           
AddColumn( IIf( BUY0, UPPER_BAND, IIf( SHORT0, LOWER_BAND, 0 ) ), "BUY ABOVE / SHORT BELOW" );


Title = Title + "\n{{VALUES}}";

AlertIF( BUY0, "SOUND C:\\Windows\\Media\\Ding.wav", "5 BAR SETUP WITH BREAKOUT", 1);
AlertIF( SHORT0, "SOUND C:\\Windows\\Media\\notify.wav", "5 BAR SETUP WITH BREAKOUT", 3 );

PlotShapes( IIf( BUY0, shapeSquare, shapeNone ), colorGreen, 0, L, Offset = -40 );
PlotShapes( IIf( BUY0, shapeSquare, shapeNone ), colorLime, 0, L, Offset = -50 );
PlotShapes( IIf( BUY0, shapeUpArrow, shapeNone ), colorWhite, 0, L, Offset = -45 );

PlotShapes( IIf( SHORT0, shapeSquare, shapeNone ), colorRed, 0, H, Offset = 40 );
PlotShapes( IIf( SHORT0, shapeSquare, shapeNone ), colorOrange, 0, H, Offset = 50 );
PlotShapes( IIf( SHORT0, shapeDownArrow, shapeNone ), colorWhite, 0, H, Offset = -45 );

Any help would be greatly appreciated.

Thanks in advance,
Vinay