Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=4
- study("Lines Test 2", overlay = true)
- pvtstr = input(3)
- var line line1 = na
- var line line2 = na
- var line line3 = na
- pvthi = pivothigh(high, pvtstr, pvtstr)
- plot(pvthi, transp = 100)
- if barstate.islast
- l = 1
- for i = 0 to 100
- if pvthi[i]
- if l == 1
- line.delete(line1)
- line1 := line.new(bar_index - i - pvtstr, high[i+pvtstr], bar_index, high[i+pvtstr])
- else
- if l == 2
- line.delete(line2)
- line2 := line.new(bar_index - i - pvtstr, high[i+pvtstr], bar_index, high[i+pvtstr])
- else
- if l == 3
- line.delete(line3)
- line3 := line.new(bar_index - i - pvtstr, high[i+pvtstr], bar_index, high[i+pvtstr])
- l := l + 1
- if l > 3
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement