Short vs Long ATR
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © cmartin81

//@version=5
indicator("short vs long ATR")
shortAtrLength = input.int(14, "short Atr")
longAtrLength = input.int(100, "long Atr")
painThreshold = input.int(40, "Pain threshold")
shortTermAtr = ta.atr(shortAtrLength)
longTermAtr = ta.atr(longAtrLength)

//plot(shortTermAtr,"short atr", color.green)
//plot(longTermAtr,"long atr", color.red)
pain = (shortTermAtr/longTermAtr * 100) - 100
painColor = pain > painThreshold? color.green: color.red
plot(pain, 'pct change', painColor, 2)
hline(painThreshold)