You are on page 1of 2

instrument { name = "Donchian Channels Arrow", overlay = true }

period = input (15, "front.period", input.integer, 1, 200)

input_group {
"DC Signal",
visible = input { default = true, type = input.plot_visibility }
}

input_group {
"Color Arrow",
colorBuy = input{default = "#00FFFF", type = input.color},
colorSell = input{default = "#FF33AF", type = input.color},
width = input{default = true, type = input.line_width},
}

input_group {
"front.top line",
upper_line_visible = input { default = true, type = input.plot_visibility },
upper_line_color = input { default = "#2384C2", type = input.color },
upper_line_width = input { default = 1, type = input.line_width }
}
input_group {
"front.middle line",
middle_line_visible = input { default = true, type = input.plot_visibility },
middle_line_color = input { default = "#FF7700", type = input.color },
middle_line_width = input { default = 1, type = input.line_width }
}
input_group {
"front.bottom line",
lower_line_visible = input { default = true, type = input.plot_visibility },
lower_line_color = input { default = "#2384C2", type = input.color },
lower_line_width = input { default = 1, type = input.line_width }
}
input_group {
"front.newind.adx.fill",
fill_visible = input { default = true, type = input.plot_visibility },
fill_color = input { default = rgba(35,132,194,0.08), type = input.color },
}
upper = highest (high, period)
lower = lowest (low, period)
middle = (upper + lower) / 2
if fill_visible then
fill { first = upper, second = lower, color = fill_color }
end
if upper_line_visible then
plot (upper, "front.top line", upper_line_color, upper_line_width)
end
if lower_line_visible then
plot (lower, "front.bottom line", lower_line_color, lower_line_width)
end
if middle_line_visible then
plot (middle, "front.middle line", middle_line_color, middle_line_width)
end

buySignal = close < lower[1]


sellSignal = close > upper[1]

if visible then
plot_shape(buySignal,
"Sniper Call",
shape_style.arrowup,
shape_size.huge,
colorBuy,
shape_location.belowbar,
0,
"",
colorBuy
)
plot_shape(sellSignal,
"Sniper Put",
shape_style.arrowdown,
shape_size.huge,
colorSell,
shape_location.abovebar,
0,
"",
colorSell
)
end

You might also like