Relative Strength Super Smoother by lastguru
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © lastguru, 2022. All right reserved

//@version=5
indicator("Relative Strength Super Smoother by lastguru", "RSSS [lastguru]", overlay=true)
import lastguru/CommonFilters/1 as cf
import lastguru/LengthAdaptation/4 as la

////////////
// Inputs //
////////////

src = input(close, title="Source", inline="1")

DynamicLow = input.int(title="Lower Bound", defval=8)
DynamicHigh = input.int(title="Upper Bound", defval=50)
RSLen = input.int(title="RSI Length (if 0, use Upper Bound)", defval=0)

newLen = math.round(la.vidyaRS(src, RSLen == 0 ? DynamicHigh : RSLen, DynamicLow, DynamicHigh))

float out = cf.supers2(src, newLen)

//////////////
// Plotting //
//////////////

plot(out, "RSSS", color=color.yellow, linewidth=2)
