```
declare lower;
input paramSet = 2;
input MAType = AverageType.EXPONENTIAL;
# parameter sets
def a = if paramSet == 1 then 8
else if paramSet == 2 then 13
else if paramSet == 3 then 21
else 34;
def b = if paramSet == 1 then 5
else if paramSet == 2 then 8
else if paramSet == 3 then 13
else 21;
def c = if paramSet == 1 then 3
else if paramSet == 2 then 5
else if paramSet == 3 then 8
else 13;
def d = if paramSet == 1 then 3
else if paramSet == 2 then 5
else if paramSet == 3 then 8
else 13;
# debug
# AddLabel(visible = Yes, text = "a=" + a + " b=" + b + " c=" + c + " d=" + d, color = Color.WHITE);
# logic
def storsi = 100 * ((rsi(a) - lowest(rsi(a), b))) / (highest(rsi(a), b) - lowest(rsi(a), b));
# main plots
plot dtosck = MovingAverage(MAType, storsi, c);
dtosck.SetDefaultColor(color.red);
dtosck.setLineWeight(1);
plot dtoscd = MovingAverage(MAType, dtosck, d);
dtoscd.SetDefaultColor(color.cyan);
dtoscd.setLineWeight(1);
# indicator lines cross - reversal
def bullish = dtosck crosses above dtoscd;
def bearish = dtosck crosses below dtoscd;
plot bullishArrow = if bullish then dtoscd else double.NaN;
bullishArrow.SetDefaultColor(color.white);
bullishArrow.SetLineWeight(5);
bullishArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
plot bearishArrow = if bearish then dtoscd else double.NaN;
bearishArrow.SetDefaultColor(color.white);
bearishArrow.SetLineWeight(5);
bearishArrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
# static plots
plot overbought = 75;
overbought.SetDefaultColor(color.light_gray);
overbought.setLineWeight(1);
overbought.hideBubble();
overbought.hideTitle();
plot oversold = 25;
oversold.SetDefaultColor(color.light_gray);
oversold.setLineWeight(1);
oversold.hideBubble();
oversold.hideTitle();
# alerts
alert(bullish, "Bullish cross", alert.bar, sound.ring);
alert(bearish, "Bearish cross", alert.bar, sound.ring);
```