PHP Code:
//@version=5
indicator(title='Pivot Points High Low Extension', shorttitle='.', overlay=true)
pvtLenL = input.int(5, minval=1, title='Pivot Length Left Hand Side')
pvtLenR = input.int(3, minval=1, title='Pivot Length Right Hand Side')
maxLvlLen = input.int(0, minval=0, title='Maximum Extension Length')
ShowHHLL = input(false, title='Show HH,LL,LH,HL Markers On Pivots Points')
WaitForClose = input(false, title='Wait For Candle Close Before Printing Pivot')
// Get High and Low Pivot Points
pvthi_ = ta.pivothigh(high, pvtLenL, pvtLenR)
pvtlo_ = ta.pivotlow(low, pvtLenL, pvtLenR)
// Force Pivot completion before plotting.
Shunt = WaitForClose ? 1 : 0
pvthi = pvthi_[Shunt]
pvtlo = pvtlo_[Shunt]
// ||-----------------------------------------------------------------------------------------------------||
// ||--- Higher Highs, Lower Highs, Higher Lows, Lower Lows -------------------------------------------||
valuewhen_1 = ta.valuewhen(pvthi, high[pvtLenR + Shunt], 1)
valuewhen_2 = ta.valuewhen(pvthi, high[pvtLenR + Shunt], 0)
higherhigh = na(pvthi) ? na : valuewhen_1 < valuewhen_2 ? pvthi : na
valuewhen_3 = ta.valuewhen(pvthi, high[pvtLenR + Shunt], 1)
valuewhen_4 = ta.valuewhen(pvthi, high[pvtLenR + Shunt], 0)
lowerhigh = na(pvthi) ? na : valuewhen_3 > valuewhen_4 ? pvthi : na
valuewhen_5 = ta.valuewhen(pvtlo, low[pvtLenR + Shunt], 1)
valuewhen_6 = ta.valuewhen(pvtlo, low[pvtLenR + Shunt], 0)
higherlow = na(pvtlo) ? na : valuewhen_5 < valuewhen_6 ? pvtlo : na
valuewhen_7 = ta.valuewhen(pvtlo, low[pvtLenR + Shunt], 1)
valuewhen_8 = ta.valuewhen(pvtlo, low[pvtLenR + Shunt], 0)
lowerlow = na(pvtlo) ? na : valuewhen_7 > valuewhen_8 ? pvtlo : na
plot(not ShowHHLL ? pvthi : na, title='PH *', style=plot.style_cross, ****=false, color=color.new(color.red, 0), offset=-pvtLenR - Shunt, linewidth=4)
plot(not ShowHHLL ? pvtlo : na, title='PL *', style=plot.style_cross, ****=false, color=color.new(color.lime, 0), offset=-pvtLenR - Shunt, linewidth=4)
width = input.int(1, minval=1)
xHigh = request.security(syminfo.tickerid, '60', high[1])
xLow = request.security(syminfo.tickerid, '60', low[1])
xClose = request.security(syminfo.tickerid, '15', close[1])
vPP = (xHigh + xLow + xClose) / 3
vR1 = vPP + vPP - xLow
vS1 = vPP - (xHigh - vPP)
vR2 = vPP + xHigh - xLow
vS2 = vPP - (xHigh - xLow)
vR3 = xHigh + 2 * (vPP - xLow)
vS3 = xLow - 2 * (xHigh - vPP)
plot(vS1, color=color.new(#ff0000, 100), title='S1', style=plot.style_steplinebr, linewidth=width)
plot(vS2, color=color.new(#ff002a, 100), title='S2', style=plot.style_steplinebr, linewidth=width)
plot(vS3, color=color.new(#ff014a, 100), title='S3', style=plot.style_steplinebr, linewidth=width)
plot(vR1, color=color.new(#009600, 100), title='R1', style=plot.style_steplinebr, linewidth=width)
plot(vR2, color=color.new(#006F00, 100), title='R2', style=plot.style_steplinebr, linewidth=width)
plot(vR3, color=color.new(#004900, 100), title='R3', style=plot.style_steplinebr, linewidth=width)
//@version=5
Base = input.timeframe(title='Larger Res than Chart', defval='240')
breakline = input(title='Breaks in lines', defval=true)
so = request.security(syminfo.tickerid, Base, open)
sh = request.security(syminfo.tickerid, Base, high)
sl = request.security(syminfo.tickerid, Base, low)
sc = request.security(syminfo.tickerid, Base, close)
br = so != so[1] and sc != sc[1] and sh != sh[1] and sl != sl[1] and breakline == true ? 1 : na
col = so > sc ? color.red : color.green
a1 = na(br) ? so : na
a2 = na(br) ? sh : na
a3 = na(br) ? sl : na
a4 = na(br) ? sc : na
p1 = plot(a1, 'Open', color.new(color.white, 0), style=plot.style_linebr)
p2 = plot(a2, 'High', color.new(color.black, 75), style=plot.style_linebr)
p3 = plot(a3, 'Low', color.new(color.black, 75), style=plot.style_linebr)
p4 = plot(a4, 'Close', col, style=plot.style_linebr)
fill(p1, p4, col, transp=25)
fill(p2, p3, color.new(color.silver, 65))
Yer İmleri