nifty gann & 100 levels
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © bumalla

//@version=5
indicator('nifty gann & 100 levels', overlay=true)

toadd = 0.
incval = 0.
selectedprice1 = 0.
selectedprice2 = 0.

selectedprice1 := input(title='Type Your Starting Gann Level', defval=17457.01)
selectedprice2 := input(title='Type Your Starting Gann Level', defval=17424)
incval := input(title='Increment Value', defval=33.01)
toadd := math.abs(selectedprice1 - selectedprice2)

line.new(bar_index, selectedprice1, bar_index[100], selectedprice1, width=2, color=color.green, style=line.style_dashed)
for i = -25 to 5 by 1
    line.new(bar_index, selectedprice1 + toadd * i, bar_index[100], selectedprice1 + toadd * i, width=1, color=color.black, style=line.style_dashed)
   
toadd1 = 0.
incval1 = 0.
selectedprice3 = 0.

selectedprice3 := input.float(title='Type Your Start 100 Level', defval=17000)
incval1 := input.float(title='Increment Value', defval=100)
toadd1 := incval1

line.new(bar_index, selectedprice3, bar_index[100], selectedprice3, width=2, color=color.red)
for j = -7 to 7 by 1
    line.new(bar_index, selectedprice3 + toadd1 * j, bar_index[100], selectedprice3 + toadd1 * j, width=2, color=color.red, style=line.style_solid)

    line.new(bar_index, selectedprice3 - toadd1 * j, bar_index[100], selectedprice3 - toadd1 * j, width=2, color=color.red, style=line.style_solid)

[PDO,PDH,PDL,PDT] = request.security(syminfo.tickerid,"D", [open[1],high[1],low[1],time[1]])


var line l_pdh = na
var line l_pdo = na
var line l_pdl = na

if barstate.islast
    l_pdh := line.new(bar_index - 1, PDH, bar_index, PDH, extend=extend.both, color=color.blue,width=2)
  
    l_pdl := line.new(bar_index - 1, PDL, bar_index, PDL, extend=extend.both, color=color.blue,width=2)
    l_pdl

line.delete(l_pdh[1])

line.delete(l_pdl[1])