// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © gambcl
//@version=6
indicator("Arrows Off BB", overlay = true)
////////////////////////////////////////////////////////////////////////////////
// Inputs
////////////////////////////////////////////////////////////////////////////////
i_bb_series = input.source(close, "Source", group = "Bollinger Bands")
i_bb_length = input.int(20, "Length", minval = 1, maxval = 999, group = "Bollinger Bands")
i_bb_mult = input.float(2.0, "Multiplier", minval = 0, step = 0.1, group = "Bollinger Bands")
i_bullish_color = input.color(#00c3ff, "Bullish", group = "Entry Signals")
i_bearish_color = input.color(#df1878, "Bearish", group = "Entry Signals")
////////////////////////////////////////////////////////////////////////////////
// Calculations
////////////////////////////////////////////////////////////////////////////////
[bb_middle, bb_upper, bb_lower] = ta.bb(i_bb_series, i_bb_length, i_bb_mult)
is_bullish_signal = barstate.isconfirmed and (close > open) and (close[1] < open[1]) and (low < bb_lower) and (low[1] < bb_lower[1])
is_bearish_signal = barstate.isconfirmed and (close < open) and (close[1] > open[1]) and (high > bb_upper) and (high[1] > bb_upper[1])
////////////////////////////////////////////////////////////////////////////////
// Plotting
////////////////////////////////////////////////////////////////////////////////
plot(bb_upper, "BB Upper", #512da8, 1, plot.style_line, linestyle = plot.linestyle_dotted)
plot(bb_middle, "BB Middle", color.olive, 1, plot.style_line, linestyle = plot.linestyle_dashed, display = display.none)
plot(bb_lower, "BB Lower", #512da8, 1, plot.style_line, linestyle = plot.linestyle_dotted)
plotshape(is_bullish_signal, "Bullish Entry", shape.arrowup, location.belowbar, i_bullish_color, size = size.normal)
plotshape(is_bearish_signal, "Bearish Entry", shape.arrowdown, location.abovebar, i_bearish_color, size = size.normal)