loxxfsrrdspfilts
// 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

// @description loxxfsrrdspfilts : FATL, SATL, RFTL, & RSTL Digital Signal Filters
library("loxxfsrrdspfilts", overlay = true)

// @function fatl
// @param src float
// @returns result float    
export fatl(float src) =>
    fatl_val = 0.4360409450 * 
         src + 0.3658689069 * 
         src[1] + 0.2460452079 * 
         src[2] + 0.1104506886 * 
         src[3] - 0.0054034585 * 
         src[4] - 0.0760367731 * 
         src[5] - 0.0933058722 * 
         src[6] - 0.0670110374 * 
         src[7] - 0.0190795053 * 
         src[8] + 0.0259609206 * 
         src[9] + 0.0502044896 * 
         src[10] + 0.0477818607 * 
         src[11] + 0.0249252327 * 
         src[12] - 0.0047706151 * 
         src[13] - 0.0272432537 * 
         src[14] - 0.0338917071 * 
         src[15] - 0.0244141482 * 
         src[16] - 0.0055774838 * 
         src[17] + 0.0128149838 * 
         src[18] + 0.0226522218 * 
         src[19] + 0.0208778257 * 
         src[20] + 0.0100299086 * 
         src[21] - 0.0036771622 * 
         src[22] - 0.0136744850 * 
         src[23] - 0.0160483392 * 
         src[24] - 0.0108597376 * 
         src[25] - 0.0016060704 * 
         src[26] + 0.0069480557 * 
         src[27] + 0.0110573605 * 
         src[28] + 0.0095711419 * 
         src[29] + 0.0040444064 * 
         src[30] - 0.0023824623 * 
         src[31] - 0.0067093714 * 
         src[32] - 0.0072003400 * 
         src[33] - 0.0047717710 * 
         src[34] + 0.0005541115 * 
         src[35] + 0.0007860160 * 
         src[36] + 0.0130129076 * 
         src[37] + 0.0040364019 * 
         src[38]
    fatl_val

// @function rftl
// @param src float
// @returns result float   
export rftl(float src) =>
    rftl_val = -0.0025097319 * 
         src + 0.0513007762 * 
         src[1] + 0.1142800493 * 
         src[2] + 0.1699342860 * 
         src[3] + 0.2025269304 * 
         src[4] + 0.2025269304 * 
         src[5] + 0.1699342860 * 
         src[6] + 0.1142800493 * 
         src[7] + 0.0513007762 * 
         src[8] - 0.0025097319 * 
         src[9] - 0.0353166244 * 
         src[10] - 0.0433375629 * 
         src[11] - 0.0311244617 * 
         src[12] - 0.0088618137 * 
         src[13] + 0.0120580088 * 
         src[14] + 0.0233183633 * 
         src[15] + 0.0221931304 * 
         src[16] + 0.0115769653 * 
         src[17] - 0.0022157966 * 
         src[18] - 0.0126536111 * 
         src[19] - 0.0157416029 * 
         src[20] - 0.0113395830 * 
         src[21] - 0.0025905610 * 
         src[22] + 0.0059521459 * 
         src[23] + 0.0105212252 * 
         src[24] + 0.0096970755 * 
         src[25] + 0.0046585685 * 
         src[26] - 0.0017079230 * 
         src[27] - 0.0063513565 * 
         src[28] - 0.0074539350 * 
         src[29] - 0.0050439973 * 
         src[30] - 0.0007459678 * 
         src[31] + 0.0032271474 * 
         src[32] + 0.0051357867 * 
         src[33] + 0.0044454862 * 
         src[34] + 0.0018784961 * 
         src[35] - 0.0011065767 * 
         src[36] - 0.0031162862 * 
         src[37] - 0.0033443253 * 
         src[38] - 0.0022163335 * 
         src[39] + 0.0002573669 * 
         src[40] + 0.0003650790 * 
         src[41] + 0.0060440751 * 
         src[42] + 0.0018747783 * 
         src[43]
    rftl_val

// @function satl
// @param src float
// @returns result float    
export satl(float src) =>
    satl_val = 0.0982862174 * 
         src + 0.0975682269 * 
         src[1] + 0.0961401078 * 
         src[2] + 0.0940230544 * 
         src[3] + 0.0912437090 * 
         src[4] + 0.0878391006 * 
         src[5] + 0.0838544303 * 
         src[6] + 0.0793406350 * 
         src[7] + 0.0743569346 * 
         src[8] + 0.0689666682 * 
         src[9] + 0.0632381578 * 
         src[10] + 0.0572428925 * 
         src[11] + 0.0510534242 * 
         src[12] + 0.0447468229 * 
         src[13] + 0.0383959950 * 
         src[14] + 0.0320735368 * 
         src[15] + 0.0258537721 * 
         src[16] + 0.0198005183 * 
         src[17] + 0.0139807863 * 
         src[18] + 0.0084512448 * 
         src[19] + 0.0032639979 * 
         src[20] - 0.0015350359 * 
         src[21] - 0.0059060082 * 
         src[22] - 0.0098190256 * 
         src[23] - 0.0132507215 * 
         src[24] - 0.0161875265 * 
         src[25] - 0.0186164872 * 
         src[26] - 0.0205446727 * 
         src[27] - 0.0219739146 * 
         src[28] - 0.0229204861 * 
         src[29] - 0.0234080863 * 
         src[30] - 0.0234566315 * 
         src[31] - 0.0231017777 * 
         src[32] - 0.0223796900 * 
         src[33] - 0.0213300463 * 
         src[34] - 0.0199924534 * 
         src[35] - 0.0184126992 * 
         src[36] - 0.0166377699 * 
         src[37] - 0.0147139428 * 
         src[38] - 0.0126796776 * 
         src[39] - 0.0105938331 * 
         src[40] - 0.0084736770 * 
         src[41] - 0.0063841850 * 
         src[42] - 0.0043466731 * 
         src[43] - 0.0023956944 * 
         src[44] - 0.0005535180 * 
         src[45] + 0.0011421469 * 
         src[46] + 0.0026845693 * 
         src[47] + 0.0040471369 * 
         src[48] + 0.0052380201 * 
         src[49] + 0.0062194591 * 
         src[50] + 0.0070340085 * 
         src[51] + 0.0076266453 * 
         src[52] + 0.0080376628 * 
         src[53] + 0.0083037666 * 
         src[54] + 0.0083694798 * 
         src[55] + 0.0082901022 * 
         src[56] + 0.0080741359 * 
         src[57] + 0.0077543820 * 
         src[58] + 0.0073260526 * 
         src[59] + 0.0068163569 * 
         src[60] + 0.0062325477 * 
         src[61] + 0.0056078229 * 
         src[62] + 0.0049516078 * 
         src[63] + 0.0161380976 * 
         src[64]
    satl_val
    
// @function rstl
// @param src float
// @returns result float    
export rstl(float src) =>
    rstl_val = -0.0074151919 * 
         src - 0.0060698985 * 
         src[1] - 0.0044979052 * 
         src[2] - 0.0027054278 * 
         src[3] - 0.0007031702 * 
         src[4] + 0.0014951741 *
         src[5] + 0.0038713513 * 
         src[6] + 0.0064043271 * 
         src[7] + 0.0090702334 * 
         src[8] + 0.0118431116 * 
         src[9] + 0.0146922652 * 
         src[10] + 0.0175884606 * 
         src[11] + 0.0204976517 * 
         src[12] + 0.0233865835 * 
         src[13] + 0.0262218588 * 
         src[14] + 0.0289681736 * 
         src[15] + 0.0315922931 * 
         src[16] + 0.0340614696 * 
         src[17] + 0.0363444061 * 
         src[18] + 0.0384120882 * 
         src[19] + 0.0402373884 * 
         src[20] + 0.0417969735 * 
         src[21] + 0.0430701377 * 
         src[22] + 0.0440399188 * 
         src[23] + 0.0446941124 * 
         src[24] + 0.0450230100 * 
         src[25] + 0.0450230100 * 
         src[26] + 0.0446941124 * 
         src[27] + 0.0440399188 * 
         src[28] + 0.0430701377 * 
         src[29] + 0.0417969735 * 
         src[30] + 0.0402373884 * 
         src[31] + 0.0384120882 * 
         src[32] + 0.0363444061 * 
         src[33] + 0.0340614696 * 
         src[34] + 0.0315922931 * 
         src[35] + 0.0289681736 * 
         src[36] + 0.0262218588 * 
         src[37] + 0.0233865835 * 
         src[38] + 0.0204976517 * 
         src[39] + 0.0175884606 * 
         src[40] + 0.0146922652 *
         src[41] + 0.0118431116 * 
         src[42] + 0.0090702334 * 
         src[43] + 0.0064043271 * 
         src[44] + 0.0038713513 * 
         src[45] + 0.0014951741 * 
         src[46] - 0.0007031702 * 
         src[47] - 0.0027054278 * 
         src[48] - 0.0044979052 * 
         src[49] - 0.0060698985 * 
         src[50] - 0.0074151919 * 
         src[51] - 0.0085278517 * 
         src[52] - 0.0094111161 *
         src[53] - 0.0100658241 * 
         src[54] - 0.0104994302 * 
         src[55] - 0.0107227904 * 
         src[56] - 0.0107450280 * 
         src[57] - 0.0105824763 * 
         src[58] - 0.0102517019 * 
         src[59] - 0.0097708805 * 
         src[60] - 0.0091581551 * 
         src[61] - 0.0084345004 * 
         src[62] - 0.0076214397 * 
         src[63] - 0.0067401718 * 
         src[64] - 0.0058083144 * 
         src[65] - 0.0048528295 * 
         src[66] - 0.0038816271 * 
         src[67] - 0.0029244713 * 
         src[68] - 0.0019911267 * 
         src[69] - 0.0010974211 * 
         src[70] - 0.0002535559 * 
         src[71] + 0.0005231953 * 
         src[72] + 0.0012297491 * 
         src[73] + 0.0018539149 * 
         src[74] + 0.0023994354 * 
         src[75] + 0.0028490136 * 
         src[76] + 0.0032221429 * 
         src[77] + 0.0034936183 * 
         src[78] + 0.0036818974 * 
         src[79] + 0.0038037944 * 
         src[80] + 0.0038338964 * 
         src[81] + 0.0037975350 * 
         src[82] + 0.0036986051 * 
         src[83] + 0.0035521320 * 
         src[84] + 0.0033559226 * 
         src[85] + 0.0031224409 * 
         src[86] + 0.0028550092 * 
         src[87] + 0.0025688349 * 
         src[88] + 0.0022682355 * 
         src[89] + 0.0073925495 * 
         src[90]
    rstl_val
    
//example usage


out = rstl(close)
    
plot(out)

    
    

        