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.
//Created by Robert Nance 7/13/15 //This script is for spinning tops. I have another script with all the major candlesticks. This one is to simply identify spinning top candlesticks stsize=input(.5, minval=.1, title="Spinning Top Size") study(title = "Spinning Tops", overlay = true) spinningtop=(open>close) and ((high-low)>(3*(open-close))and(((high-open)/(.001+high-low))< stsize)and (((close-low)/(.001+high-low))< stsize))or (close>open) and ((high-low)>(3*(close-open))and(((high-close)/(.001+high-low))< stsize)and (((open-low)/(.001+high-low))< stsize)) plotchar(spinningtop, title="Spinning Top", text='ST', color=yellow, char='+')