I have created a pine script in TradingView to draw line from pivot to pivot like a trendline which has slope and is not horizontal. Now i want to add alert to these lines so that when price crosses the last line i can get an alert. Here is the sample code:
line upper = line.new(x1, y1, x2, y2, extend=extend.right, color=color1, width=width1)
line lower = line.new(x1, y1, x2, y2, extend=extend.right, color=color2, width=width1)
So how is it possible to add alert to this line?