Alerts on alert() function 

Within the Pine Script® there's an additional function that lets you configure alerts — it's called the alert() function and you'll see it in the code when it's configurable. From Supercharts, you can create an alert using the "Create alert" dialog and select the indicator or strategy in the "Condition" field.

Unlike other alert types, the triggering frequency and the message are determined by the script's alert() calls — not by the dialog settings.

To create an alert()-based alert for an indicator:

  1. Select the script in the "Condition" field of the “Create Alert” dialog
  2. Choose "Any alert() function call" (the first option)

Script alerts on strategies can include order fill events, "alert()" function call events, or both.

  • "Order fills and alert() function calls": The created alerts trigger on both order fills and "alert()" events
  • "Order fills only": The alert triggers only on order fills, like a standard strategy alert
  • "alert() function calls only": The alert triggers only on "alert()" events, similar to a script alert on an indicator

! Note: If a script alert triggers more than 15 times within three minutes, it automatically stops.

More information about using the "alert()" function in scripts can be found in the Pine Reference Manual and the Pine User Manual.

Also read: