Round Numbers
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © jacasanare
// This is a variation of "Round numbers above and below" indicator by BitcoinJesus-Not-Roger-Ver


//@version=4

study("Round Numbers", overlay=true)

//1st set of lines
var number_of_lines_1 = input(5, title="Number of Lines 1", type=input.integer)
var range_size_1 = input(100, title="Range Size 1", type=input.integer)


var step1 = syminfo.mintick*range_size_1
if barstate.islast
    //label.new(bar_index, low, text=syminfo.type, yloc=yloc.abovebar)
    for counter1 = 0 to number_of_lines_1 - 1
        stepUp1 = ceil(close / step1) * step1 + (counter1 * step1)
        line.new(bar_index, stepUp1, bar_index - 1, stepUp1, xloc=xloc.bar_index, extend=extend.both, color=color.purple, width=1, style=line.style_dashed)
        stepDown1 = floor(close / step1) * step1 - (counter1 * step1)
        line.new(bar_index, stepDown1, bar_index - 1, stepDown1, xloc=xloc.bar_index, extend=extend.both, color=color.purple, width=1, style=line.style_dashed)


//2nd set of lines
var number_of_lines_2 = input(2, title="Number of Lines 2", type=input.integer)
var range_size_2 = input(500, title="Range Size 2", type=input.integer)


var step2 = syminfo.mintick*range_size_2
if barstate.islast
    //label.new(bar_index, low, text=syminfo.type, yloc=yloc.abovebar)
    for counter2 = 0 to number_of_lines_2 - 1
        stepUp2 = ceil(close / step2) * step2 + (counter2 * step2)
        line.new(bar_index, stepUp2, bar_index - 1, stepUp2, xloc=xloc.bar_index, extend=extend.both, color=color.green, width=1, style=line.style_solid)
        stepDown2 = floor(close / step2) * step2 - (counter2 * step2)
        line.new(bar_index, stepDown2, bar_index - 1, stepDown2, xloc=xloc.bar_index, extend=extend.both, color=color.green, width=1, style=line.style_solid)
        