AD's -   Indecisive Candles, volume spikes, gaps
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Mkt_RnD

//@version=5
indicator("Indecisive Candles, volume spikes, gaps", title="AD's", overlay=true)



// Identification of pivots

//mom = input(50, minval=1, title="Percentage for Momentum Candle")
indec = input.int(15, minval=1, title="Percentage for Indecision Candle")
//momentum = abs(open-close) >= mom*abs(high-low)/100
indecision = math.abs(open-close) < indec*math.abs(high-low)/100
//plotshape(momentum, style=shape.cross, location=location.abovebar, color=green, text='M')
plotshape(indecision, style=shape.circle, location=location.abovebar, color=color.red)

//Voluen spikes - twice the volume of 20 SMA of volume

sma_volume = ta.sma(volume, 20)*2
volume_above_sma = volume > sma_volume
plotshape(volume_above_sma, style=shape.triangleup, location=location.belowbar, color=color.blue)



//Gap Identification
barcolor(math.abs(high[1]) < math.abs(low)? color.green:math.abs(low[1]) > math.abs(high)? color.red:na)

