PHP Code:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © daytraderph
//@version=5
indicator('Dynamic Range', overlay=true)
res = input.timeframe(defval='D')
dayrange = high - low
r1 = request.security(syminfo.tickerid, res, dayrange[1])
r2 = request.security(syminfo.tickerid, res, dayrange[2])
r3 = request.security(syminfo.tickerid, res, dayrange[3])
r4 = request.security(syminfo.tickerid, res, dayrange[4])
r5 = request.security(syminfo.tickerid, res, dayrange[5])
r6 = request.security(syminfo.tickerid, res, dayrange[6])
r7 = request.security(syminfo.tickerid, res, dayrange[7])
r8 = request.security(syminfo.tickerid, res, dayrange[8])
r9 = request.security(syminfo.tickerid, res, dayrange[9])
r10 = request.security(syminfo.tickerid, res, dayrange[10])
r11 = request.security(syminfo.tickerid, res, dayrange[11])
r12 = request.security(syminfo.tickerid, res, dayrange[12])
oo = request.security(syminfo.tickerid, res, open, barmerge.gaps_off, barmerge.lookahead_on)
zone1 = oo + (r1 + r2 + r3 + r4 + r5) / 10
zone2 = oo + (r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8 + r9 + r10) / 10 / 2
zone3 = oo - (r1 + r2 + r3 + r4 + r5) / 10
zone4 = oo - (r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8 + r9 + r10) / 10 / 2
z1 = plot(zone1, title='D-Range', color=color.new(color.yellow, 0), linewidth=1, style=plot.style_cross)
//z2 = plot(zone2, title='Z2', color=color.new(color.green, 0), linewidth=1, style=plot.style_circles)
//z3 = plot(zone3, title='Z3', color=color.new(color.red, 0), linewidth=1, style=plot.style_circles)
z4 = plot(zone4, title='D-Range', color=color.new(color.aqua, 0), linewidth=1, style=plot.style_cross)