RLT Gaps
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MattDeLong

//@version=5
indicator("RLT Gaps", overlay=false)
gapsize = input.float(title="Gap Size", minval=0.01, maxval=25.0, step=0.01, defval=2.0, confirm=false)
sizeOfGap = ((close[1]-open)/close[1]) * -100
asizeOfGap = math.abs(sizeOfGap)
plot(sizeOfGap, title='sizeOfGap', color=color.orange, linewidth=1)

bullgng = close[1]<open[1] and open>close[1] and timeframe.isdaily and asizeOfGap>=gapsize
bullrtg = close[1]>open[1] and open>close[1] and timeframe.isdaily and asizeOfGap>=gapsize
beargng = close[1]>open[1] and open<close[1] and timeframe.isdaily and asizeOfGap>=gapsize
bearrtg = close[1]<open[1] and open<close[1] and timeframe.isdaily and asizeOfGap>=gapsize

plotshape(bullgng, style=shape.flag, location=location.bottom, color=color.green, text='GNG')
plotshape(bullrtg, style=shape.xcross, location=location.bottom, color=color.green, text='RTG')
plotshape(beargng, style=shape.flag, location=location.bottom, color=color.red, text='GNG')
plotshape(bearrtg, style=shape.xcross, location=location.bottom, color=color.red, text='RTG')
