10 pips
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © d3cod3dman

//@version=5
indicator("10 pips", overlay = true)
pips = input.float(10, "How many pips to offset?", group = "First range")
color   color1 = input.color(color.rgb(0, 55, 255), "Color for range 1", group = "First range")
use2 = input.bool(true, "Show second range?", group = "Second range")
pips2 = input.float(20, "How many pips to offset?", group = "Second range")
color   color2 = input.color(color.rgb(78, 199, 255), "Color for range 2", group = "Second range")
lineLenght = input.int(2, "Length of the lines", 1, 10, 1,group = "Properties of the lines")
lineWidth = input.int(2, "Width of the lines", 1, 3,group = "Properties of the lines")

var lup = line.new(0,0,0,0)
var ldown = line.new(0,0,0,0)
var lup2 = line.new(0,0,0,0)
var ldown2 = line.new(0,0,0,0)

if syminfo.mintick == 0.00001
    pips := pips*10*syminfo.mintick
    pips2 := pips2*10*syminfo.mintick
if syminfo.mintick == 0.001
    pips := pips*10*syminfo.mintick
    pips2 := pips2*10*syminfo.mintick
if syminfo.mintick == 0.01
    pips := pips*10*syminfo.mintick
    pips2 := pips2*10*syminfo.mintick
if syminfo.mintick > 0.2
    pips := pips
    pips2 := pips2

if timeframe.isintraday
    line.delete(lup)
    line.delete(ldown)
    lup := line.new(bar_index, close + pips, bar_index[lineLenght], close + pips, color=color1, style=line.style_solid, width=lineWidth)
    ldown := line.new(bar_index, close - pips, bar_index[lineLenght], close - pips, color=color1, style=line.style_solid, width=lineWidth)
    if use2
        line.delete(lup2)
        line.delete(ldown2)
        lup2 := line.new(bar_index, close + pips2, bar_index[lineLenght], close + pips2, color=color2, style=line.style_solid, width=lineWidth)
        ldown2 := line.new(bar_index, close - pips2, bar_index[lineLenght], close - pips2, color=color2, style=line.style_solid, width=lineWidth)