ATR Momentum [QuantVue]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © QuantVue

//@version=5
indicator("ATR Momentum [QuantVue]", overlay = false)

//inputs
atr1Len =   input.int(5, 'Short ATR Length')
atr2Len =   input.int(20, 'Long ATR Length')
atrMult =   input.float(1.0, 'Multiplier', minval = .25, step = .25)

//ATR
shortATR =  ta.atr(atr1Len)
longATR =   ta.atr(atr2Len)

//condition
expanding = shortATR > (longATR * atrMult)

//styling
fillColor =     color.new(color.white,100)
fillColor :=    expanding ? color.green : not expanding ? color.red : fillColor

//plots
shortPlot =     plot(shortATR, 'Short ATR', color = color.black, display = display.pane)
longPlot =      plot(longATR, 'Long ATR', color = color.black, display = display.pane)
fill(shortPlot, longPlot, fillColor)

//alerts
alertcondition(expanding, 'Increasing Momentum', '{{ticker}} has increasing momentum')