The code below draws the Last Price Line/ line for the last traded price. It uses the line.new() function to create the line. How do I draw the same line using the plot() function?
//@version=4
study("My Script", overlay=true)
var line lastPriceLine = line.new(0, 0, 0, 0)
line.set_xy1(lastPriceLine, bar_index-50, close)
line.set_xy2(lastPriceLine, bar_index, close)
