Simple ATR indicator with the input that allows user to select the smoothing algorithm. Classical ATR uses rma smoothing.
study(title="Average True Range (Custom)", shorttitle="ATR_C", overlay=false) smooth = input(1, minval=1, maxval=3, title='Smoothing: 1-rma, 2-sma, 3-ema') length = input(14, minval=1) atr = smooth == 1 ? rma(tr, length) : smooth == 2 ? sma(tr, length) : smooth == 3 ? ema(tr, length) : na plot(atr, color=red)