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.
//*** Doji Add-on
dsize = input(0.05, "Doji size", minval=0.01, step=.01)
doji=(abs(open - close) <= (high - low) * dsize)
plotshape(open > close and doji, title="Doji", style=shape.cross, location=location.abovebar, size=size.tiny, color=color.black, transp=20)
plotshape(open < close and doji, title="Doji", style=shape.cross, location=location.belowbar, size=size.tiny, color=color.black, transp=20)