Advertisement
JustUncleL

Pivot5

Mar 24th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. //@version=3
  2. //
  3. study(title="Pivot5",overlay=true)
  4. //
  5.  
  6. pivothigh5() =>
  7. ls = high[10]<high[5] and high[9]<high[5] and high[8]<high[5] and high[7]<high[5] and high[6]<=high[5]
  8. rs = high[0]<high[5] and high[1]<high[5] and high[2]<high[5] and high[3]<high[5] and high[4]<high[5]
  9. ret= ls and rs
  10. ret
  11.  
  12.  
  13. pivotlow5() =>
  14. ls = low[10]>low[5] and low[9]>low[5] and low[8]>low[5] and low[7]>low[5] and low[6]>=low[5]
  15. rs = low[0]>low[5] and low[1]>low[5] and low[2]>low[5] and low[3]>low[5] and low[4]>low[5]
  16. ret= ls and rs
  17. ret
  18.  
  19. ph = pivothigh5()
  20. pl = pivotlow5()
  21.  
  22. plotshape(ph, title='High Pivot', location=location.abovebar, style=shape.diamond, color=green, offset=-5,transp=0,size=size.auto)
  23. plotshape(pl, title='Low Pivot', location=location.belowbar, style=shape.diamond, color=red, offset=-5,transp=0,size=size.auto)
  24.  
  25. //eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement