last bar only signal

 
How do I program the condition/signal (with an indicator) so that it is triggering the acoustic alert only if s predifined condition is true FOR THE LAST BAR in the chart?
(now the alert is triggered as soon as I add the indicator to the chart window (due to previous signals in the chart) I'd appreciate any help, thanks