Price based ATR%
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © carlpwilliams2

//@version=5
indicator("Price based ATR%", overlay=true)

priceAdditionModifier = input.float(1.5, title="Modifier", tooltip="Price Addition Modifier i.e 1.5 * ATR", minval=-0.01, group="Upper ATR Line (Added line)")
priceSubtractModifier = input.float(1, title="Modifier", tooltip="Price Subtraction Modifier i.e 1 * ATR", minval=-0.01, group="Lower ATR Line (Subtracted line)")

additionSource = input.source(close,title="Source for addition atr", group="Upper ATR Line (Added line)")
subtractSource = input.source(close,title="Source for subtract atr", group="Lower ATR Line (Subtracted line)")

upperATRLength = input.int(14,title="Length", group="Upper ATR Line (Added line)")
LowerATRLength = input.int(14,title="Length", group="Lower ATR Line (Subtracted line)")

upperATR = ta.atr(upperATRLength)
lowerATR = ta.atr(upperATRLength)

pricePlusATR = additionSource + ( (additionSource/100) * (upperATR * priceAdditionModifier))
priceSubtractATR = subtractSource - ( (subtractSource/100) * (lowerATR * priceSubtractModifier))

plot(pricePlusATR, color=color.white)
plot(priceSubtractATR, color=color.white)

