instrument { name = "Canal Bordas de Bolinger", icon="indicators:ADX", overlay =
true }
period = input (5, "[Link]", [Link], 1)
shift = input (1, "[Link]", [Link], 0.01, 300, 0.01)
fn = input ([Link], "[Link]", input.string_selection,
[Link])
input_group {
"[Link] line",
upper_line_visible = input { default = true, type = input.plot_visibility },
upper_line_color = input { default = "#ff0000", type = [Link] },
upper_line_width = input { default = 1, type = input.line_width }
}
input_group {
"[Link] line",
middle_line_visible = input { default = true, type = input.plot_visibility },
middle_line_color = input { default = #ffffff, type = [Link] },
middle_line_width = input { default = 1, type = input.line_width }
}
input_group {
"[Link] line",
lower_line_visible = input { default = true, type = input.plot_visibility },
lower_line_color = input { default = "#00FF00", type = [Link] },
lower_line_width = input { default = 1, type = input.line_width }
}
input_group {
"[Link]",
fill_visible = input { default = true, type = input.plot_visibility },
fill_color = input { default = rgba(33,177,144,0.08), type = [Link] },
}
local averageFunction = averages [fn]
middle = averageFunction (hlc3, period)
offset = rma(tr, period) * shift
upper = middle + offset
lower = middle - offset
if fill_visible then
fill { first = upper, second = lower, color = fill_color }
end
if upper_line_visible then
plot (upper, "Upper", upper_line_color, upper_line_width)
end
if lower_line_visible then
plot (lower, "Lower", lower_line_color, lower_line_width)
end
if middle_line_visible then
plot (middle, "Middle", middle_line_color, middle_line_width)
end