Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- study("Double Bottom Pattern", overlay=true)
- length = input(15,title="length")
- pvtLenL = length
- pvtLenR = length
- pl = pivotlow(pvtLenL, pvtLenR)
- WaitForClose = input(true)
- pvtlo_ = pivotlow(low, pvtLenL, pvtLenR)
- Shunt = WaitForClose ? 1 : 0
- pvtlo = pvtlo_[Shunt]
- lowerlow0 = ( valuewhen(pvtlo, low[pvtLenR+Shunt], 1) > valuewhen(pvtlo, low[pvtLenR+Shunt], 0) )
- x1 = crossunder(close,valuewhen(pvtlo, low[pvtLenR+Shunt], 0) )
- x = x1[1] and lowerlow0 and close > open
- x2 = low <= lowest(low,120)
- x3 = x2[1]
- /////
- recent_x=na
- for i=0 to (pvtLenR+3)
- recent_x:=x[i]
- if recent_x==true
- break
- pl_col=recent_x?black:na
- //plot(pl,linewidth=4,color=pl_col,offset=-pvtLenL)
- /////
- //plotshape(x , text="Double Bottom", title='Double Bottom', style=shape.labelup, color=green, textcolor=white, location=location.belowbar, transp=0)
- //pl_col=recent_x?black:na
- plot(pl,linewidth=4,color=pl_col,offset=-pvtLenL)
- /////
- //plotshape(x , text="Double Bottom", title='Double Bottom', style=shape.labelup, color=green, textcolor=white, location=location.belowbar, transp=0)
- dub_btm=x and not recent_x[1]
- plotshape(dub_btm, text="Double Bottom", title='Double Bottom', style=shape.labelup, color=green, textcolor=white, location=location.belowbar, transp=0)
Add Comment
Please, Sign In to add comment