I will try to implement this for inside day failure as well.
This will improve the stats of this failed PA play.
study(title = "OF V1", overlay = true) showlabel = input(title="Show label", type=bool, defval=true) pctP = input(50, minval=1, maxval=99, title="Percentage Input For PBars, What % The Wick Of Candle Has To Be") pblb = input(1, minval=1, maxval=100, title="PBars Look Back Period To Define The Trend of Highs and Lows") //PBar Percentages pctCp = pctP * .01 pctCPO = 1 - pctCp range = high - low insidebar = (high <= high and low >= low) outsidebar = (high > high and low < low) and not (insidebar) bearishobbf = ((outsidebar and (high > high and close < high) and open < high - (range * pctCp) and close < high-(range * pctCp) and high >= highest(pblb) ? 1 : 0)) bullishobbf = ((outsidebar and (low < low and close > low) and open > high - (range * pctCPO) and close > high - (range * pctCPO) and low <= lowest(pblb) ? 1 : 0)) barcolor(bearishobbf ? white : na, 0, true, "OF") plotshape(showlabel ? bearishobbf : na, title= "OF", location=location.abovebar, color=white, style=shape.arrowdown, text="OF") barcolor(bullishobbf ? white : na, 0, true, "OF") plotshape(showlabel ? bullishobbf : na, title= "OF", location=location.belowbar, color=white, style=shape.arrowup, text="OF")