alert
Fires an alert with this message. Only counts on live bars (never on history) and only when the user made an alert on this script for "Any alert() call". freq: alert.freq_once_per_bar (the first call on a bar, the default), alert.freq_once_per_bar_close (only on the bar's close) or alert.freq_all (every call, on every tick of the forming bar).
alert(message: string, freq: string = "once_per_bar")
Parameters
messagestring: The alert text; na sends "na".freqstring: alert.freq_*
Example
if ta.crossover(close, ta.sma(close, 20))
alert("Long " + str.tostring(close), alert.freq_once_per_bar_close)