FATL, SATL, RFTL, & RSTL Digital Filters Raw [Loxx]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © loxx

//@version=5
indicator("FATL, SATL, RFTL, & RSTL Digital Filters Raw [Loxx]", 
     shorttitle = "FSRRDFR [Loxx]", 
     overlay = true, 
     timeframe="", 
     timeframe_gaps = true)

import loxx/loxxfsrrdspfilts/1

greencolor = #2DD204
redcolor = #D2042D 

dspinp = input.string("SATL - Slow Adaptive Trend Line", "Digital Filter Type", options = ["FATL - Fast Adaptive Trend Line", "SATL - Slow Adaptive Trend Line", 
     "RFTL - Reference Fast Trend Line", "RSTL - Reference Slow Trend Line"], group = "Digital Filter Settings")


src = input.source(close, title="Source", group = "Basic Settings")
colorbars = input.bool(false, "Color bars?", group= "UI Options")

out = 
     dspinp == "FATL - Fast Adaptive Trend Line" ? loxxfsrrdspfilts.fatl(src) :
     dspinp == "SATL - Slow Adaptive Trend Line" ? loxxfsrrdspfilts.satl(src) :
     dspinp == "RFTL - Reference Fast Trend Line" ? loxxfsrrdspfilts.rftl(src) :
     loxxfsrrdspfilts.rstl(src)
     
plot(out, color = out > out[1] ? greencolor : redcolor, linewidth = 3)
barcolor(colorbars ? out > out[1] ? greencolor : redcolor : na)
