alertcondition
Declares a named alert condition: the user picks it by its title when making an alert on this script, and the alert fires while the condition is true (on a tick or at the bar close, as the user chose). Has no effect on the chart. The message may use {{ticker}} {{timeframe}} {{close}} {{price}} {{time}} and {{plot("Title")}}.
alertcondition(condition: bool, title: const string = na, message: const string = na)
Parameters
conditionbool: The condition checked on each bar; the alert fires while it is true.titleconst string: The name the user picks when making the alert.messageconst string: The alert text, with the {{...}} placeholders above (default none).
Example
alertcondition(ta.crossover(fast, slow), "Long setup", "{{ticker}} long at {{close}}")