Line Colorizer - Durbtrade
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Durbtrade
//@version=5
// Durbtrade - Line Colorizer

indicator(title="Line Colorizer - Durbtrade", shorttitle="Line Colorizer - Durbtrade", timeframe="", overlay = true,  timeframe_gaps=true, explicit_plot_zorder = true)

src1a = input(true, "Source 1", group="Sources", inline = "1")
src1b = input(close, title="", group="Sources", inline = "1")
src2a = input(false, "Source 2", group="Sources", inline = "2")
src2b = input(close, title="", group="Sources", inline = "2")
src3a = input(false, "Source 3", group="Sources", inline = "3")
src3b = input(close, title="", group="Sources", inline = "3")
src4a = input(false, "Source 4", group="Sources", inline = "4")
src4b = input(close, title="", group="Sources", inline = "4")
src5a = input(false, "Source 5", group="Sources", inline = "5")
src5b = input(close, title="", group="Sources", inline = "5")
src6a = input(false, "Source 6", group="Sources", inline = "6")
src6b = input(close, title="", group="Sources", inline = "6")
src7a = input(false, "Source 7", group="Sources", inline = "7")
src7b = input(close, title="", group="Sources", inline = "7")
src8a = input(false, "Source 8", group="Sources", inline = "8")
src8b = input(close, title="", group="Sources", inline = "8")
src9a = input(false, "Source 9", group="Sources", inline = "9")
src9b = input(close, title="", group="Sources", inline = "9")
src10a = input(false, "Source 10", group="Sources", inline = "10")
src10b = input(close, title="", group="Sources", inline = "10")

up = color.new(#17ff00, 0) 
down = color.new(#ff0000, 0)
equal = color.new(#0300ff, 0) 

plot(src1a == false ? na : src1b, "Colorized Source 1", color=  src1b - src1b[1] >0 ? up: src1b - src1b[1] == 0 ? equal : down, linewidth = 2)
plot(src2a == false ? na : src2b, "Colorized Source 2", color=  src2b - src2b[1] >0 ? up: src2b - src2b[1] == 0 ? equal : down, linewidth = 2)
plot(src3a == false ? na : src3b, "Colorized Source 3", color=  src3b - src3b[1] >0 ? up: src3b - src3b[1] == 0 ? equal : down, linewidth = 2)
plot(src4a == false ? na : src4b, "Colorized Source 4", color=  src4b - src4b[1] >0 ? up: src4b - src4b[1] == 0 ? equal : down, linewidth = 2)
plot(src5a == false ? na : src5b, "Colorized Source 5", color=  src5b - src5b[1] >0 ? up: src5b - src5b[1] == 0 ? equal : down, linewidth = 2)
plot(src6a == false ? na : src6b, "Colorized Source 6", color=  src6b - src6b[1] >0 ? up: src6b - src6b[1] == 0 ? equal : down, linewidth = 2)
plot(src7a == false ? na : src7b, "Colorized Source 7", color=  src7b - src7b[1] >0 ? up: src7b - src7b[1] == 0 ? equal : down, linewidth = 2)
plot(src8a == false ? na : src8b, "Colorized Source 8", color=  src8b - src8b[1] >0 ? up: src8b - src8b[1] == 0 ? equal : down, linewidth = 2)
plot(src9a == false ? na : src9b, "Colorized Source 9", color=  src9b - src9b[1] >0 ? up: src9b - src9b[1] == 0 ? equal : down, linewidth = 2)
plot(src10a == false ? na : src10b, "Colorized Source 10", color=  src10b - src10b[1] >0 ? up: src10b - src10b[1] == 0 ? equal : down, linewidth = 2)

// Durbtrade - Line Colorizer