MTF ATR Levels by makuchaku
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © makuchaku

//@version=5
indicator("MTF ATR Levels by makuchaku", overlay=true)
atrPeriod  = input.int(12, "atrPeriod")
levelOffset = input.int(5, "levelOffset")
timeFrame = input.timeframe('D', "timeFrame")


mtf_atr = request.security(syminfo.tickerid, timeFrame, expression=ta.atr(atrPeriod))
mtf_close = request.security(syminfo.tickerid, timeFrame, expression=close[1])

// Above
plotchar(mtf_close + (0.75*mtf_atr), char='―', show_last=1, location=location.absolute, offset=levelOffset, color=color.new(color.red, 80), size=size.large, title="+75% Range")
plotchar(mtf_close + mtf_atr, char='―', show_last=1, location=location.absolute, offset=levelOffset, color=color.new(color.red, 60), size=size.large, title="+100% Range")
plotchar(mtf_close + (1.5*mtf_atr), char='―', show_last=1, location=location.absolute, offset=levelOffset, color=color.new(color.red, 40), size=size.large, title="+150% Range")
plotchar(mtf_close + (2*mtf_atr), char='―', show_last=1, location=location.absolute, offset=levelOffset, color=color.new(color.red, 20), size=size.large, title="+200% Range")
plotchar(mtf_close + (3*mtf_atr), char='―', show_last=1, location=location.absolute, offset=levelOffset, color=color.new(color.red, 0), size=size.large, title="+300% Range")

// Below
plotchar(mtf_close - (0.75*mtf_atr), char='―', show_last=1, location=location.absolute, offset=levelOffset, color=color.new(color.green, 80), size=size.large, title="-75% Range")
plotchar(mtf_close - mtf_atr, char='―', show_last=1, location=location.absolute, offset=levelOffset, color=color.new(color.green, 60), size=size.large, title="-100% Range")
plotchar(mtf_close - (1.5*mtf_atr), char='―', show_last=1, location=location.absolute, offset=levelOffset, color=color.new(color.green, 40), size=size.large, title="-150% Range")
plotchar(mtf_close - (2*mtf_atr), char='―', show_last=1, location=location.absolute, offset=levelOffset, color=color.new(color.green, 20), size=size.large, title="-200% Range")
plotchar(mtf_close - (3*mtf_atr), char='―', show_last=1, location=location.absolute, offset=levelOffset, color=color.new(color.green, 0), size=size.large, title="-300% Range")

