Advertisement
Guest User

3 lower highs

a guest
Sep 22nd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. //@version=3
  2. study("3 Lower Highs", overlay=true)
  3.  
  4. // Inputs
  5. leftbars = input(3)
  6. rightbars = input(3)
  7.  
  8. // Define highs
  9. ph = pivothigh(high, leftbars, rightbars)
  10.  
  11. // Three lower highs
  12. firsthighs = if valuewhen(ph, high, 0) < valuewhen(ph[1], high, 0)
  13. 1
  14. lasthighs = if valuewhen(ph[1], high, 0) < valuewhen(ph[2], high, 0)
  15. 1
  16. threelowerhighs = firsthighs==1 and lasthighs==1
  17.  
  18. // Plot
  19. plotshape(threelowerhighs, color=red, location=location.belowbar, style=shape.labelup, text="3 Lower Highs")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement