Minimalistic ATR
//This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//© FloppyDisque
//@version=5
indicator("ATR", overlay = true)
length = input.int(14, "Length", minval = 1)
smoothing = input.string("RMA", title = "Smoothing", options = ["RMA", "SMA", "EMA", "WMA"])
ma_function(source, length) =>
	switch smoothing
		"RMA" => ta.rma(source, length)
		"SMA" => ta.sma(source, length)
		"EMA" => ta.ema(source, length)
		"WMA"=> ta.wma(source, length)
plotchar(ma_function(ta.tr(true), length), title = "ATR", char = "", color = color.new(color.blue, 100))