Blog : How to Create Alerts on TradingView with an Indicator Script
Why Alerts are Important?
TradingView alerts are a great way to stay updated on market conditions and respond in real time, whether you're at your screen or away. Alerts can be set up for a variety of trading conditions, making them ideal for personal notifications or even automated trading systems. If you've generated an indicator script using the GetPineScript tool, setting up alerts is quick and easy.
If you're using the GetPineScript tool to generate custom TradingView indicator scripts, setting up alerts is straightforward. Just be sure to enable the "Include Alerts" option in the "Visibility & Misc" section when configuring your indicator. Alerts can be useful both for manual monitoring and auto-trading with platforms that support webhook notifications. In this guide, we'll walk you through the steps to create alerts for your indicator script.
Step-by-Step Guide to Setting Alerts in TradingView with an Indicator Script
- 1 Apply the Indicator Script to Your Chart. If you're unsure how to add Pine Script source code to your chart, simply follow the instructions.
- 2 Add an Alert on the Chart. Make sure to select the asset and timeframe for which you want to receive alerts.
Go to your chart's toolbar and click "Add Alert". This will bring up the alert creation window, where you can configure the alert for your indicator script.
- 3 Select Alert Condition and Trigger Type.
In the create alert window, choose the condition you want the alert to be based on. Also, select the trigger type that suits your indicator, such as "Once Per Bar Close" or "Once Per Bar". "Once Per Bar Close" option is commonly used for entry and close alerts, while the "Once Per Bar" option is more suitable for inner bar actions like take-profit and stop-loss.
- 4 Name Your Alert and Adjust the Message field.
Provide a clear "Alert Name" for easy reference. In the "Message" field, you can customize the message as you wish. This message will be sent to you when the alert is triggered, so make sure it's informative for your needs. You can also retrieve entry, take-profit, and stop-loss prices using placeholder values in the message box, as shown below.
Long Side Example:
Long Entry Price: {{plot("Long Entry Price")}}
Long Take-Profit: {{plot("Long Take-Profit Price")}}
Long Stop-Loss: {{plot("Long Stop-Loss Price")}}
Short Side Example:
Short Entry Price: {{plot("Short Entry Price")}}
Short Take-Profit: {{plot("Short Take-Profit Price")}}
Short Stop-Loss: {{plot("Short Stop-Loss Price")}} - 5 Configure Notifications.
Switch to the "Notifications" tab. Here, you can choose how you want to be notified. Options notify in app, email notifications, SMS, or webhook integration, which is useful for automating trades with third-party services.
- 6 Click Create.
Finally, once you're satisfied with the setup, click "Create". Your alert is now active, and TradingView will notify you when the conditions are met.
- 🎉 Congratulations! That's it! With these steps, you can create alerts using your custom indicator scripts generated with GetPineScript. If you make any parameter changes in the settings, be sure to delete the old alert and create a new one, otherwise, the alert will trigger based on your previous setup.