//High&Low Levels
len = input(80, title='Length',group = 'Higher High-Lower Low / ZIGZAG')
Depth = len
Deviation = input.int(1, 'Deviation', minval=1, step=1, group = 'Higher High-Lower Low / ZIGZAG')
Backstep = input.int(5, 'Backstep', minval=1, step=1, group = 'Higher High-Lower Low / ZIGZAG')
var last_h = 1
last_h += 1
var last_l = 1
last_l += 1
var lw = 1
lw += 1
var hg = 1
hg += 1
p_lw = -ta.lowestbars(Depth)
p_hg = -ta.highestbars(Depth)
lowing = lw == p_lw or low - low[p_lw] > Deviation * syminfo.mintick
highing = hg == p_hg or high[p_hg] - high > Deviation * syminfo.mintick
lh = ta.barssince(not highing[1])
ll = ta.barssince(not lowing[1])
down = ta.barssince(not(lh > ll)) >= Backstep
lower = low[lw] > low[p_lw]
higher = high[hg] < high[p_hg]
if lw != p_lw and (not down[1] or lower)
lw := p_lw < hg ? p_lw : 0
if hg != p_hg and (down[1] or higher)
hg := p_hg < lw ? p_hg : 0
line zz = na
label point = na
x1 = down ? lw : hg
y1 = down ? low[lw] : high[hg]
if down == down[1]
line.delete(zz[1])
label.delete(point[1])
if down != down[1]
if down
last_h := hg
last_h
else
last_l := lw
last_l
zz := line.new(bar_index - (down ? last_h : last_l), down ? high[last_h] : low[last_l], bar_index - x1, y1, style=line.style_solid, width=2, color=down ? color.new(color.red,transp=50) : color.new(color.teal,transp=50))
point := label.new(bar_index - x1, y1, down ? low[x1] < low[last_l] ? 'LL' : 'HL' : high[x1] > high[last_h] ? 'HH' : 'LH', style=down ? label.style_label_up : label.style_label_down, size=size.small, color=down ? color.new(color.black, 0) : color.new(color.black, 0), textcolor=color.white, tooltip=down ? low[x1] < low[last_l] ? 'Lower Low' : 'Higher Low' : high[x1] > high[last_h] ? 'Higher High' : 'Lower High')
//fibonacci
lenf = input(80,title='Length',group = 'FIBONACCI')
f2 = input.float(defval = 0.236, title = 'FIB 1', step=0.001, group = 'FIBONACCI')
f3 = input.float(defval = 0.382, title = 'FIB 2', step=0.001, group = 'FIBONACCI')
f4 = input.float(defval = 0.500, title = 'FIB 3', step=0.001, group = 'FIBONACCI')
f5 = input.float(defval = 0.618, title = 'FIB 4', step=0.001, group = 'FIBONACCI')
f6 = input.float(defval = 0.786, title = 'FIB 5', step=0.001, group = 'FIBONACCI')
high_point = ta.highest(high,lenf)
low_point = ta.lowest(low,lenf)
diff = high_point - low_point
fib1 = high_point
fib2 = fib1 - diff * f2
fib3 = fib1 - diff * f3
fib4 = fib1 - diff * f4
fib5 = fib1 - diff * f5
fib6 = fib1 - diff * f6
fib7 = low_point
ps1 = (fib1 > fib1[1])
plotshape(ps1, title='Latest Bulliesh Power', style=shape.triangleup, color=color.teal ,size=size.tiny, location=location.abovebar,editable = false)
ps2 = (fib7 < fib7[1])
plotshape(ps2, title='LatestBearieshPower', style=shape.triangledown, color=color.red , size=size.tiny, location=location.belowbar,editable = false)
fibx1=line.new(bar_index - x1,fib1,last_bar_index ,fib1,extend=extend.both, color = color.black,style = line.style_solid,width = 1)
fibx4=line.new(bar_index - x1,fib4,last_bar_index ,fib4,extend=extend.both, color = color.black,style = line.style_dashed,width = 1)
fibx7=line.new(bar_index - x1,fib7,last_bar_index ,fib7,extend=extend.both, color = color.black,style = line.style_solid,width = 1)
line.delete(fibx1[1])
line.delete(fibx4[1])
line.delete(fibx7[1])
bt=box.new(bar_index - x1,fib1,last_bar_index+30,fib2,bgcolor = color.new(color.orange,90),border_color = color.new(color.black,100),text='',text_size = size.normal,text_halign = text.align_right,text_valign = text.align_top,extend = extend.both)
box.delete(bt[1])
bc=box.new(bar_index - x1,fib3,last_bar_index+30,fib5,bgcolor = color.new(color.orange,90),border_color = color.new(color.black,100),text='',text_size = size.normal,text_halign = text.align_right,text_valign = text.align_center,extend = extend.both)
box.delete(bc[1])
bb=box.new(bar_index - x1,fib6,last_bar_index+30,fib7,bgcolor = color.new(color.orange,90),border_color = color.new(color.black,100),text='',text_size = size.normal,text_halign = text.align_right,text_valign = text.align_bottom,extend = extend.both)
box.delete(bb[1])
//
//VWAP
vwapAnchorInput = input.string("Daily", "Anchor", options = ["Daily", "Weekly", "Monthly"],group = 'VWAP')
stdevMultiplierInput1 = input.float(1.618, "Standard Deviation Multiplier-1", step = 0.01, minval = 0.01,group = 'VWAP')
stdevMultiplierInput2 = input.float(1.786, "Standard Deviation Multiplier-2", step = 0.01, minval = 0.01,group = 'VWAP')
stdevMultiplierInput3 = input.float(2, "Standard Deviation Multiplier-3", step = 0.01, minval = 0.01,group = 'VWAP')
anchorTimeframe = switch vwapAnchorInput
"Daily" => "1D"
"Weekly" => "1W"
"Monthly" => "1M"
anchor = timeframe.change(anchorTimeframe)
[vwap1, upperx1, lowerx1] = ta.vwap(hlc3, anchor, stdevMultiplierInput1)
vx1=plot(vwap1,color = color.new(color.blue,0),linewidth=2,editable = false,display = display.pane)
vx2=plot(upperx1, color = color.new(color.red,0),linewidth=1,editable = false,display = display.pane)
vx3=plot(lowerx1, color = color.new(color.green,0),linewidth=1,editable = false,display = display.pane)
[vwap2, upperx2, lowerx2] = ta.vwap(hl2, anchor, stdevMultiplierInput2)
vy1=plot(upperx2, color =color.new(color.red,0),linewidth=1,editable = false,display = display.pane)
vy2=plot(lowerx2, color = color.new(color.green,0),linewidth=1,editable = false,display = display.pane)
[vwap3, upperx3, lowerx3] = ta.vwap(hl2, anchor, stdevMultiplierInput3)
vz1=plot(upperx3, color =color.new(color.red,0),linewidth=2,editable = false,display = display.pane)
vz2=plot(lowerx3, color = color.new(color.teal,0),linewidth=2,editable = false,display = display.pane)
fill(vz1,vz2,color = color.new(color.black,80),editable = false)
fill(vx2,vz1,color = color.new(color.red,85),editable = false)
fill(vx3,vz2,color = color.new(color.green,85),editable = false)
//lOGO --------------------------------------------------------------------------------------- //
// ---------------------------------------------------------------------------------------------- //
var table logo = table.new(position.bottom_right, 1, 1)
if barstate.islast
table.cell(logo, 0, 0, '𝕂ℍ𝕆𝕆𝕃𝕀𝕆-𝟚𝟘𝟚𝟛', text_size=size.normal, text_color=#ff0000)
//