Ill make an overlay version
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
study(title="Gap Finder - Max Warren", shorttitle="GapFinder-MW", overlay=false, precision=4) ldist = high-low hdist = high-low gline=input(true, title="Display lines") zline=input(true, title="Zero line") ldistout = gline==true ? ldist : na hdistout = gline==true ? hdist : na zout = zline==true ? 0 : na plot(ldistout) plot(hdistout) hline(zout, linestyle=dotted) cgapup = #ff0000 cgapdown = #f0ff0f cnogap = na gapthing = high < low ? cgapup : low > high ? cgapdown : cnogap bgcolor(gapthing, transp=60)