Trading view alerts every bar close, how can i have just one?
11:29 27 Jan 2023

I have a problem: Trading view trigger alerts every bar close which is a major problem to me, because pineconnector keeps making orders based on the alerts received.

While I have no major experience with pine script , this is a major problem to me , if anyone would help me get the alert just one until the next reverse signal, I would be more grateful.

This is the code I have on my pine script strategy :

if buy 
    alert(buy_alert_string,alert.freq_once_per_bar_close)
    strategy.entry('buy', strategy.long)
if sell
    strategy.entry('sell', strategy.short)
    alert(sell_alert_string,alert.freq_once_per_bar_close)
pine-script tradingview-api alerts