Pine Script strategy sends duplicate alerts on bar close
My strategy fires the same alert twice on bar close. I'm using alert() inside the strategy.entry block.
My strategy fires the same alert twice on bar close. I'm using alert() inside the strategy.entry block.
To avoid duplicate alerts, you need to select the correct alert trigger option in TradingView.
-Step 1: Open the TradingView Alert
Open your strategy alert and go to the alert condition options.
-Step 2: Select the Correct Option
Select “alert() function calls only” instead of “Order fills and alert() function calls”, as shown in the image below.

-Step 3: Create the Alert
Save the alert with this option selected.
When you select “Order fills and alert() function calls,” TradingView can trigger alerts for both strategy order fills and alert() function calls. If your script uses alert() inside the strategy entry logic, both can generate notifications for the same trading event.
By selecting “alert() function calls only,” the alert will trigger only when the script calls alert(), preventing duplicate notifications from the combined alert sources.