Arbitrary Horizontal Lines
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © NobbiTrading

//@version=5
indicator("Arbitrary Horizontal Lines", overlay = true)
prices1 = input.string("", "Prices", tooltip = "Enter prices comma separated without any spaces.", group = "Group 1")
color1 = input.color(color.orange, "Color", group = "Group 1")
width1 = input.int(6, "Width", group = "Group 1")

prices2 = input.string("", "Prices", tooltip = "Enter prices comma separated without any spaces.", group = "Group 2")
color2 = input.color(color.green, "Color", group = "Group 2")
width2 = input.int(6, "Width", group = "Group 2")

prices3 = input.string("", "Prices", tooltip = "Enter prices comma separated without any spaces.", group = "Group 3")
color3 = input.color(color.red, "Color", group = "Group 3")
width3 = input.int(6, "Width", group = "Group 3")

aprices1 = str.split(prices1, ',')
for x in aprices1
    y = str.tonumber(x)
    line.new(bar_index, y, bar_index +1, y, extend = extend.both, color=color1, width = width1)

aprices2 = str.split(prices2, ',')
for x in aprices2
    y = str.tonumber(x)
    line.new(bar_index, y, bar_index +1, y, extend = extend.both, color=color2, width = width2)

aprices3 = str.split(prices3, ',')
for x in aprices3
    y = str.tonumber(x)
    line.new(bar_index, y, bar_index +1, y, extend = extend.both, color=color3, width = width3)