Professional Documents
Culture Documents
ph = pivothigh(rb, rb)
pl = pivotlow(rb, rb)
plotshape(ph and showpp, text="[H]", style=shape.labeldown, color=color.white,
textcolor=color.black, location=location.abovebar, transp=0, offset = -rb)
plotshape(pl and showpp, text="[L]", style=shape.labelup, color=color.white,
textcolor=color.black, location=location.belowbar, transp=0, offset = -rb)
float sr1 = na, float sr2 = na, float sr3 = na, float sr4 = na, float sr5 = na,
float sr6 = na, float sr7 = na, float sr8 = na, float sr9 = na, float sr10 = na
float sr11 = na, float sr12 = na, float sr13 = na, float sr14 = na, float sr15 =
na, float sr16 = na, float sr17 = na, float sr18 = na, float sr19 = na, float sr20
= na
prdhighest = highest(prd)
prdlowest = lowest(prd)
cwidth = (prdhighest - prdlowest) * ChannelW / 100
ppavailable(ind)=>
_ret = ind == 1 and a1 ? true : ind == 2 and a2 ? true : ind == 3
and a3 ? true : ind == 4 and a4 ? true : ind == 5 and a5 ? true :
ind == 6 and a6 ? true : ind == 7 and a7 ? true : ind == 8
and a8 ? true : ind == 9 and a9 ? true : ind == 10 and a10 ? true :
ind == 11 and a11 ? true : ind == 12 and a12 ? true : ind == 13
and a13 ? true : ind == 14 and a14 ? true : ind == 15 and a15 ? true :
ind == 16 and a16 ? true : ind == 17 and a17 ? true : ind == 18
and a18 ? true : ind == 19 and a19 ? true : ind == 20 and a20 ? true :
ind == 21 and a21 ? true : ind == 22 and a22 ? true : ind == 23
and a23 ? true : ind == 24 and a24 ? true : ind == 25 and a25 ? true :
ind == 26 and a26 ? true : ind == 27 and a27 ? true : ind == 28
and a28 ? true : ind == 29 and a29 ? true : ind == 30 and a30 ? true :
ind == 31 and a31 ? true : ind == 32 and a32 ? true : ind == 33
and a33 ? true : ind == 34 and a34 ? true : ind == 35 and a35 ? true :
ind == 36 and a36 ? true : ind == 37 and a37 ? true : ind == 38
and a38 ? true : ind == 39 and a39 ? true : ind == 40 and a40 ? true :
false
set_a(t1, a1)=>
_ret = not t1 ? false : a1
u1 = 0.0, u1 := nz(u1[1])
d1 = 0.0, d1 := nz(d1[1])
highestph = 0.0
lowestpl = 0.0
highestph := highestph[1]
lowestpl := lowestpl[1]
if ph or pl
sr1 := na, sr2 := na, sr3 := na, sr4 := na, sr5 := na, sr6 := na, sr7 := na,
sr8 := na, sr9 := na, sr10 := na
sr11 := na, sr12 := na, sr13 := na, sr14 := na, sr15 := na, sr16 := na, sr17 :=
na, sr18 := na, sr19 := na, sr20 := na
highestph := prdlowest
lowestpl := prdhighest
countpp = 0
for x = 0 to prd
if na(close[x])
break
if not na(ph[x]) or not na(pl[x])
highestph := max(highestph, nz(ph[x], prdlowest), nz(pl[x], prdlowest))
lowestpl := min(lowestpl, nz(ph[x], prdhighest), nz(pl[x], prdhighest))
countpp := countpp + 1
if ppavailable(countpp)
upl = (ph[x] ? high[x+rb] : low[x+rb]) + cwidth
dnl = (ph[x] ? high[x+rb] : low[x+rb]) - cwidth
u1 := countpp == 1 ? upl : u1
d1 := countpp == 1 ? dnl : d1
if not na(pl[xx])
if low[xx+rb] <= upl and low[xx+rb] >= dnl
tpoint := tpoint + 1
chg := true
if ph or pl
line highest_ = na, highest_ := highest_[1]
line lowest_ = na, lowest_ := lowest_[1]
line.delete(highest_)
line.delete(lowest_)
if drawhl
highest_ := line.new(bar_index - prd , highestph, bar_index , highestph,
color = color.blue, style = line.style_dashed, width = 1, extend = extend.right)
lowest_ := line.new(bar_index - prd , lowestpl, bar_index , lowestpl, color
= color.blue, style = line.style_dashed, width = 1, extend = extend.right)
line l1 = na, line l2 = na, line l3 = na, line l4 = na, line l5 = na, line l6 =
na, line l7 = na, line l8 = na, line l9 = na, line l10 = na
line l11 = na, line l12 = na, line l13 = na, line l14 = na, line l15 = na, line
l16 = na, line l17 = na, line l18 = na, line l19 = na, line l20 = na
l1 := sr1 ? setline(sr1) : na
l2 := sr2 ? setline(sr2) : na
l3 := sr3 ? setline(sr3) : na
l4 := sr4 ? setline(sr4) : na
l5 := sr5 ? setline(sr5) : na
l6 := sr6 ? setline(sr6) : na
l7 := sr7 ? setline(sr7) : na
l8 := sr8 ? setline(sr8) : na
l9 := sr9 ? setline(sr9) : na
l10 := sr10 ? setline(sr10) : na
l11 := sr11 ? setline(sr11) : na
l12 := sr12 ? setline(sr12) : na
l13 := sr13 ? setline(sr13) : na
l14 := sr14 ? setline(sr14) : na
l15 := sr15 ? setline(sr15) : na
l16 := sr16 ? setline(sr16) : na
l17 := sr17 ? setline(sr17) : na
l18 := sr18 ? setline(sr18) : na
l19 := sr19 ? setline(sr19) : na
l20 := sr20 ? setline(sr20) : na