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

Example

alertcondition(ta.crossover(fast, slow), "Long setup", "{{ticker}} long at {{close}}")