AnthonyAlexander

DB Pattern- 4/5 completed

Jan 4th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. //@version=3
  2. study("Double Bottom Pattern", overlay=true)
  3. length = input(15,title="length")
  4. pvtLenL = length
  5. pvtLenR = length
  6. pl = pivotlow(pvtLenL, pvtLenR)
  7. WaitForClose = input(true)
  8. pvtlo_ = pivotlow(low, pvtLenL, pvtLenR)
  9. Shunt = WaitForClose ? 1 : 0
  10. pvtlo = pvtlo_[Shunt]
  11. lowerlow0 = ( valuewhen(pvtlo, low[pvtLenR+Shunt], 1) > valuewhen(pvtlo, low[pvtLenR+Shunt], 0) )
  12. x1 = crossunder(close,valuewhen(pvtlo, low[pvtLenR+Shunt], 0) )
  13. x = x1[1] and lowerlow0 and close > open
  14. x2 = low <= lowest(low,120)
  15. x3 = x2[1]
  16. /////
  17. recent_x=na
  18. for i=0 to (pvtLenR+3)
  19. recent_x:=x[i]
  20. if recent_x==true
  21. break
  22. pl_col=recent_x?black:na
  23.  
  24. //plot(pl,linewidth=4,color=pl_col,offset=-pvtLenL)
  25. /////
  26. //plotshape(x , text="Double Bottom", title='Double Bottom', style=shape.labelup, color=green, textcolor=white, location=location.belowbar, transp=0)
  27.  
  28. //pl_col=recent_x?black:na
  29. plot(pl,linewidth=4,color=pl_col,offset=-pvtLenL)
  30. /////
  31. //plotshape(x , text="Double Bottom", title='Double Bottom', style=shape.labelup, color=green, textcolor=white, location=location.belowbar, transp=0)
  32.  
  33. dub_btm=x and not recent_x[1]
  34.  
  35. 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