I made an array containing all of the price points that i had, and then I ran a for loop after that with a statement to create a horizontal line with each of the price points. This is my first night learning pine editor, i have no clue how to find/use their terminal or where the error messages pop out.
float[] priceList = array.from(138.73, 140.47, 139.59, 141.25, 138.9)
for i = 0 to array.size(priceList) - 1
hline([i], title = "Price Line", color = color.red, linestyle = hline.style_solid, linewidth = 2)
The code won't compile, since
hlinefunction requires input form type. Use the newer, more flexible,linefunction:Some side notes -
for...inloop.EDIT:
If you do want to create new lines and delete them later using an array, you can use another
arraywhich will be an array of lines, and then delete the lines if a condition is met: