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 Chris Guthrie on September 11, 2016 study(title="Range_Outlier_Action", shorttitle="RNG_Outlier_Action", overlay=true) bsa = input(true, title="Display Buy-Sell Arrows") bsl = input(true, title="Display Buy-Sell Letters") //Moving Averages smaHI = sma(high, 10) smaLO = sma(low, 10) //Basic Criteria Schema plHI = plot(smaHI, title="High MA", style=line, linewidth=2, color=lime) plLO = plot(smaLO, title="Low MA", style=line, linewidth=2, color=red) fill(plHI, plLO, color=silver, transp=75) //Aggressive Trend Entry entryADT = smaHI < high and smaHI < high and high < high entryAUT = low < smaLO and low < smaLO and low > low //Conservative Trend Entry entryCDT = smaHI < high and smaHI < high  and high < high and high < high  entryCUT = low < smaLO and low < smaLO and low > low and low > low //Symbology //plotarrow(bsa and entryADT ? entryADT : na, title="Aggressive Down Trend Entry", colordown=red, maxheight=30, minheight=30, transp=0) //plotarrow(bsa and entryAUT ? entryAUT : na, title="Aggressive Up Trend Entry", colorup=lime, maxheight=30, minheight=30, transp=0) plotchar(bsl and entryCDT ? entryCDT : na, title="Conservative Down Trend Entry", offset=0, char='S', location=location.abovebar, color=red, transp=0) plotchar(bsl and entryCUT ? entryCUT : na, title="Conservative Up Trend Entry", offset=0, char='B', location=location.belowbar, color=lime, transp=0)